Skip to contentSkip to conversation

drm/exynos: exynos_hdmi: Pass correct pointer to free_irq()

PATCH In review Lars-Peter Clausen 3 participants 3 messages May 20, 2013 – May 21, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos: exynos_hdmi: Pass correct pointer to free_irq()

free_irq() expects the same pointer that was passed to request_threaded_irq(), otherwise the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_threaded_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
index bbfc384..7e99853 100644
@@ -2082,7 +2082,7 @@ static int hdmi_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(dev);
 
-	free_irq(hdata->irq, hdata);
+	free_irq(hdata->irq, ctx);
 
 
 	/* hdmiphy i2c driver */
Signature · 1 line
1.8.0
maintainer Acked-by on v1 1/1
#1 lore raw

Good point,

Quoted 19 lines · Lars-Peter Clausen

free_irq() expects the same pointer that was passed to request_threaded_irq(), otherwise the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_threaded_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

Quoted 7 lines

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

Quoted 18 lines
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
index bbfc384..7e99853 100644
@@ -2082,7 +2082,7 @@ static int hdmi_remove(struct platform_device *pdev)
 
 	pm_runtime_disable(dev);
 
-	free_irq(hdata->irq, hdata);
+	free_irq(hdata->irq, ctx);
 
 
 	/* hdmiphy i2c driver */
Signature · 3 lines
Seung-Woo Kim
Samsung Software R&D Center
--
maintainer
#2 lore raw
In reply to Lars-Peter Clausen

2013/5/21 Lars-Peter Clausen <[email protected]>

Quoted 37 lines

free_irq() expects the same pointer that was passed to request_threaded_irq(),
otherwise the IRQ is not freed.

The issue was found using the following coccinelle script:

<smpl>
@r1@
type T;
T devid;
@@
request_threaded_irq(..., devid)

@r2@
type r1.T;
T devid;
position p;
@@
free_irq@p(..., devid)

@@
position p != r2.p;
@@
*free_irq@p(...)
</smpl>

---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -0
index bbfc384..7e99853 100644

drivers/gpu/drm/exynos/exynos_hdmi.c static int hdmi_remove(struct platform_device *pdev) · line 2087

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -1
@@ -2082,7 +2082,7 @@ static int hdmi_remove(struct platform_device *pdev)
 
        pm_runtime_disable(dev);
 
-       free_irq(hdata->irq, hdata);
+       free_irq(hdata->irq, ctx);
 
 

It's better to use devm_reqeust_irq instead. Anyway that was a bug. Applied.

Thanks,
Inki Dae

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -1
        /* hdmiphy i2c driver */
--

1.8.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel