• V
    drm/amdgpu: Use drm_mode_init() for on-stack modes · 0a204ce0
    Ville Syrjälä 提交于
    Initialize on-stack modes with drm_mode_init() to guarantee
    no stack garbage in the list head, or that we aren't copying
    over another mode's list head.
    
    Based on the following cocci script, with manual fixups:
    @decl@
    identifier M;
    expression E;
    @@
    - struct drm_display_mode M = E;
    + struct drm_display_mode M;
    
    @@
    identifier decl.M;
    expression decl.E;
    statement S, S1;
    @@
    struct drm_display_mode M;
    ... when != S
    + drm_mode_init(&M, &E);
    +
    S1
    
    @@
    expression decl.E;
    @@
    - &*E
    + E
    
    Cc: Harry Wentland <harry.wentland@amd.com>
    Cc: Leo Li <sunpeng.li@amd.com>
    Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Cc: amd-gfx@lists.freedesktop.org
    Reviewed-by: NHarry Wentland <harry.wentland@amd.com>
    Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
    0a204ce0
amdgpu_dm.c 293.8 KB