aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
diff options
context:
space:
mode:
authorSrinivasan Shanmugam <[email protected]>2025-04-23 13:30:09 +0000
committerAlex Deucher <[email protected]>2025-04-30 22:05:52 +0000
commit716ad3c28f9d228558de18d5c4aae00bcc6a2a9c (patch)
treee425714a52e9ff204632634ab66f983f5092cf74 /drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
parentdrm/amdkfd: Set SDMA_RLCx_IB_CNTL/SWITCH_INSIDE_IB (diff)
downloadkernel-716ad3c28f9d228558de18d5c4aae00bcc6a2a9c.tar.gz
kernel-716ad3c28f9d228558de18d5c4aae00bcc6a2a9c.zip
drm/amd/display: Fix NULL pointer dereference for program_lut_mode in dcn401_populate_mcm_luts
This commit introduces a NULL pointer check for mpc->funcs->program_lut_mode in the dcn401_populate_mcm_luts function. The previous implementation directly called program_lut_mode without validating its existence, which could lead to a NULL pointer dereference. With this change, the function is now only invoked if mpc->funcs->program_lut_mode is not NULL Fixes the below: drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn401/dcn401_hwseq.c:720 dcn401_populate_mcm_luts() error: we previously assumed 'mpc->funcs->program_lut_mode' could be null (see line 701) drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn401/dcn401_hwseq.c 642 void dcn401_populate_mcm_luts(struct dc *dc, 643 struct pipe_ctx *pipe_ctx, 644 struct dc_cm2_func_luts mcm_luts, 645 bool lut_bank_a) 646 { ... 716 } 717 if (m_lut_params.pwl) { 718 if (mpc->funcs->mcm.populate_lut) 719 mpc->funcs->mcm.populate_lut(mpc, m_lut_params, lut_bank_a, mpcc_id); --> 720 mpc->funcs->program_lut_mode(mpc, MCM_LUT_SHAPER, MCM_LUT_ENABLE, lut_bank_a, mpcc_id); Cc: Yihan Zhu <[email protected]> Cc: Harry Wentland <[email protected]> Cc: Nicholas Kazlauskas <[email protected]> Cc: Tom Chung <[email protected]> Cc: Roman Li <[email protected]> Cc: Alex Hung <[email protected]> Cc: Aurabindo Pillai <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Srinivasan Shanmugam <[email protected]> Reviewed-by: Yihan Zhu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c')
0 files changed, 0 insertions, 0 deletions