]> www.infradead.org Git - users/hch/configfs.git/commit
drm/amd/display: Add NULL check for function pointer in dcn401_set_output_transfer_func
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 31 Jul 2024 07:52:06 +0000 (13:22 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 6 Aug 2024 14:44:13 +0000 (10:44 -0400)
commitdd340acd42c24a3f28dd22fae6bf38662334264c
treed2a5bcfd02fc3bb3fd9ecaf7cac09ec0efd13b53
parent62ed6f0f198da04e884062264df308277628004f
drm/amd/display: Add NULL check for function pointer in dcn401_set_output_transfer_func

This commit adds a null check for the set_output_gamma function pointer
in the dcn401_set_output_transfer_func function. Previously,
set_output_gamma was being checked for null, but then it was being
dereferenced without any null check. This could lead to a null pointer
dereference if set_output_gamma is null.

To fix this, we now ensure that set_output_gamma is not null before
dereferencing it. We do this by adding a null check for set_output_gamma
before the call to set_output_gamma.

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>
Cc: Hamza Mahfooz <hamza.mahfooz@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/dc/hwss/dcn401/dcn401_hwseq.c