Skip to content

Commit 530f272

Browse files
Aleksandr Mishinlumag
authored andcommitted
drm/msm/dpu: Add callback function pointer check before its call
In dpu_core_irq_callback_handler() callback function pointer is compared to NULL, but then callback function is unconditionally called by this pointer. Fix this bug by adding conditional return. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c929ac6 ("drm/msm/dpu: allow just single IRQ callback") Signed-off-by: Aleksandr Mishin <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/588237/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 00f2489 commit 530f272

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct dpu_kms *dpu_kms, unsigned int
223223

224224
VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
225225

226-
if (!irq_entry->cb)
226+
if (!irq_entry->cb) {
227227
DRM_ERROR("no registered cb, IRQ=[%d, %d]\n",
228228
DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
229+
return;
230+
}
229231

230232
atomic_inc(&irq_entry->count);
231233

0 commit comments

Comments
 (0)