Commit 72e45e92 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Dave Airlie

drm: Preserve the list head in drm_mode_copy

Preserve the destination mode's list head in drm_mode_copy. Just
in case someone decides that it's a good idea to overwrite a mode which
happens to be on some list,
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent f6fb754d
...@@ -789,16 +789,17 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo); ...@@ -789,16 +789,17 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
* LOCKING: * LOCKING:
* None. * None.
* *
* Copy an existing mode into another mode, preserving the object id * Copy an existing mode into another mode, preserving the object id and
* of the destination mode. * list head of the destination mode.
*/ */
void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src) void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
{ {
int id = dst->base.id; int id = dst->base.id;
struct list_head head = dst->head;
*dst = *src; *dst = *src;
dst->base.id = id; dst->base.id = id;
INIT_LIST_HEAD(&dst->head); dst->head = head;
} }
EXPORT_SYMBOL(drm_mode_copy); EXPORT_SYMBOL(drm_mode_copy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment