Re: [PATCH 6.6.y] drm/amd/display: Add null check for head_pipe in dcn201_acquire_free_pipe_for_layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 18, 2025 at 02:18:18PM +0800, Xiangyu Chen wrote:
> From: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
> 
> [ Upstream commit f22f4754aaa47d8c59f166ba3042182859e5dff7 ]
> 
> This commit addresses a potential null pointer dereference issue in the
> `dcn201_acquire_free_pipe_for_layer` function. The issue could occur
> when `head_pipe` is null.
> 
> The fix adds a check to ensure `head_pipe` is not null before asserting
> it. If `head_pipe` is null, the function returns NULL to prevent a
> potential null pointer dereference.
> 
> Reported by smatch:
> drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn201/dcn201_resource.c:1016 dcn201_acquire_free_pipe_for_layer() error: we previously assumed 'head_pipe' could be null (see line 1010)
> 
> Cc: Tom Chung <chiahsuan.chung@xxxxxxx>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx>
> Cc: Roman Li <roman.li@xxxxxxx>
> Cc: Alex Hung <alex.hung@xxxxxxx>
> Cc: Aurabindo Pillai <aurabindo.pillai@xxxxxxx>
> Cc: Harry Wentland <harry.wentland@xxxxxxx>
> Cc: Hamza Mahfooz <hamza.mahfooz@xxxxxxx>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@xxxxxxx>
> Reviewed-by: Tom Chung <chiahsuan.chung@xxxxxxx>
> Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
> [dcn201 was moved from drivers/gpu/drm/amd/display/dc to
> drivers/gpu/drm/amd/display/dc/resource since
> 8b8eed05a1c6 ("drm/amd/display: Refactor resource into component directory").
> The path is changed accordingly to apply the patch on 6.6.y.]
> Signed-off-by: Xiangyu Chen <xiangyu.chen@xxxxxxxxxxxxx>
> Signed-off-by: He Zhe <zhe.he@xxxxxxxxxxxxx>
> ---
> Verified the build test only due to we don't have DCN201 device.

If you don't have this, why do you need or want it backported to
different stable kernels?

confused,

greg k-h




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux