]> www.infradead.org Git - users/hch/configfs.git/commit
drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update...
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Fri, 2 Aug 2024 07:05:13 +0000 (12:35 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Aug 2024 14:44:24 +0000 (10:44 -0400)
commitcd9e9e0852d501f169aa3bb34e4b413d2eb48c37
treebdd42cf9e87a78f1b308912bf33905743d3b75aa
parent027347d17a16562f3be272833243b835c21aa2a5
drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2)

This commit adds a null check for the 'afb' variable in the
amdgpu_dm_plane_handle_cursor_update function. Previously, 'afb' was
assumed to be null, but was used later in the code without a null check.
This could potentially lead to a null pointer dereference.

Changes since v1:
- Moved the null check for 'afb' to the line where 'afb' is used. (Alex)

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_plane.c:1298 amdgpu_dm_plane_handle_cursor_update() error: we previously assumed 'afb' could be null (see line 1252)

Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Co-developed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c