]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm: bridge: anx7625: Fix NULL pointer dereference with early IRQ
authorLoic Poulain <loic.poulain@oss.qualcomm.com>
Wed, 9 Jul 2025 08:54:38 +0000 (10:54 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Mon, 15 Sep 2025 18:44:42 +0000 (21:44 +0300)
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 <loic.poulain@oss.qualcomm.com>
Fixes: 8bdfc5dae4e3 ("drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250709085438.56188-1-loic.poulain@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/bridge/analogix/anx7625.c

index c0ad8f59e4839810b695b27e116193d2b227e1b3..8b3304dedcd9982090c323431a648660a957109d 100644 (file)
@@ -2677,7 +2677,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)
                ret = devm_request_threaded_irq(dev, platform->pdata.intp_irq,
                                                NULL, anx7625_intr_hpd_isr,
                                                IRQF_TRIGGER_FALLING |
-                                               IRQF_ONESHOT,
+                                               IRQF_ONESHOT | IRQF_NO_AUTOEN,
                                                "anx7625-intp", platform);
                if (ret) {
                        DRM_DEV_ERROR(dev, "fail to request irq\n");
@@ -2746,8 +2746,10 @@ static int anx7625_i2c_probe(struct i2c_client *client)
        }
 
        /* Add work function */
-       if (platform->pdata.intp_irq)
+       if (platform->pdata.intp_irq) {
+               enable_irq(platform->pdata.intp_irq);
                queue_work(platform->workqueue, &platform->work);
+       }
 
        if (platform->pdata.audio_en)
                anx7625_register_audio(dev, platform);