Commit a35faec3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher
Browse files

drm/amdgpu: Off by one in dm_dmub_outbox1_low_irq()



The > ARRAY_SIZE() should be >= ARRAY_SIZE() to prevent an out of bounds
access.

Fixes: e27c41d5 ("drm/amd/display: Support for DMUB HPD interrupt handling")
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent caa5eadc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -769,7 +769,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)


		do {
		do {
			dc_stat_get_dmub_notification(adev->dm.dc, &notify);
			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);
				DRM_ERROR("DM: notify type %d invalid!", notify.type);
				continue;
				continue;
			}
			}