Skip to content

Commit

Permalink
drm/amdgpu: Off by one in dm_dmub_outbox1_low_irq()
Browse files Browse the repository at this point in the history
The > ARRAY_SIZE() should be >= ARRAY_SIZE() to prevent an out of bounds
access.

Fixes: e27c41d ("drm/amd/display: Support for DMUB HPD interrupt handling")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Dan Carpenter authored and Alex Deucher committed May 26, 2022
1 parent caa5ead commit a35faec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)

do {
dc_stat_get_dmub_notification(adev->dm.dc, &notify);
if (notify.type > ARRAY_SIZE(dm->dmub_thread_offload)) {
if (notify.type >= ARRAY_SIZE(dm->dmub_thread_offload)) {
DRM_ERROR("DM: notify type %d invalid!", notify.type);
continue;
}
Expand Down

0 comments on commit a35faec

Please sign in to comment.