Skip to content

Commit 1a7ea29

Browse files
Loic Poulaingregkh
authored andcommitted
drm: bridge: anx7625: Fix NULL pointer dereference with early IRQ
[ Upstream commit a10f910 ] If the interrupt occurs before resource initialization is complete, the interrupt handler/worker may access uninitialized data such as the I2C tcpc_client device, potentially leading to NULL pointer dereference. Signed-off-by: Loic Poulain <[email protected]> Fixes: 8bdfc5d ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP") Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e6a1df8 commit 1a7ea29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/bridge/analogix/anx7625.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,7 +2678,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
26782678
ret = devm_request_threaded_irq(dev, platform->pdata.intp_irq,
26792679
NULL, anx7625_intr_hpd_isr,
26802680
IRQF_TRIGGER_FALLING |
2681-
IRQF_ONESHOT,
2681+
IRQF_ONESHOT | IRQF_NO_AUTOEN,
26822682
"anx7625-intp", platform);
26832683
if (ret) {
26842684
DRM_DEV_ERROR(dev, "fail to request irq\n");
@@ -2747,8 +2747,10 @@ static int anx7625_i2c_probe(struct i2c_client *client)
27472747
}
27482748

27492749
/* Add work function */
2750-
if (platform->pdata.intp_irq)
2750+
if (platform->pdata.intp_irq) {
2751+
enable_irq(platform->pdata.intp_irq);
27512752
queue_work(platform->workqueue, &platform->work);
2753+
}
27522754

27532755
if (platform->pdata.audio_en)
27542756
anx7625_register_audio(dev, platform);

0 commit comments

Comments
 (0)