drm/exynos: fix ref count leak in mic_pre_enable
Subsystems (3)
PATCH 1/1 drm/exynos: fix ref count leak in mic_pre_enable
in mic_pre_enable, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning.
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_mic.c +1 -1
@@ -270,7 +270,7 @@ static void mic_pre_enable(struct drm_bridge *bridge) ret =pm_runtime_get_sync (mic->dev);if (ret <0 ) - goto unlock; + goto turn_off;mic_set_path (mic,1 );
Signature · 1 line
2.17.1
Inki Dae
maintainerHi,
20. 6. 14. 오후 3:23에 Navid Emamdoost 이(가) 쓴 글:
Quoted 14 lines
in
mic_pre_enable,pm_runtime_get_syncis called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0
drivers/gpu/drm/exynos/exynos_drm_mic.c static void mic_pre_enable(struct drm_bridge *bridge) · line 273
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +1
-1@@ -270,7 +270,7 @@ static void mic_pre_enable(struct drm_bridge *bridge) ret =pm_runtime_get_sync (mic->dev);if (ret <0 ) - goto unlock; + goto turn_off;
How about just calling pm_runtime_put_noidle()?
if (ret < 0) {
pm_runtime_put_noidle(mic->dev);
goto unlock;
}Thanks,
Inki Dae
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0mic_set_path (mic,1 );
PATCH v2 1/1 drm/exynos: fix ref count leak in mic_pre_enable
in mic_pre_enable, pm_runtime_get_sync is called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning.
---
Changes in v2:
- reuse the unlock label and call pm_runtime_put_noidle
---
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_mic.c +3 -1
@@ -269,8 +269,10 @@ static void mic_pre_enable(struct drm_bridge *bridge) goto unlock; ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (mic->dev); goto unlock; + }mic_set_path (mic,1 );
Signature · 1 line
2.17.1
Inki Dae
maintainer20. 6. 15. 오후 2:49에 Navid Emamdoost 이(가) 쓴 글:
Quoted 8 lines
in
mic_pre_enable,pm_runtime_get_syncis called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning.Signed-off-by Navid Emamdoost <[email protected]>---
Changes in v2:
- reuse the unlock label and callpm_runtime_put_noidle
Picked it up.
Thanks,
Inki Dae
Quoted 12 lines
---
--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0@@ -269,8 +269,10 @@ static void mic_pre_enable(struct drm_bridge *bridge) goto unlock;
drivers/gpu/drm/exynos/exynos_drm_mic.c static void mic_pre_enable(struct drm_bridge *bridge) · line 278
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +3
-1ret =pm_runtime_get_sync (mic->dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_noidle (mic->dev); goto unlock; + }mic_set_path (mic,1 );
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 26 lines · Inki Dae
Hi,
20. 6. 14. 오후 3:23에 Navid Emamdoost 이(가) 쓴 글:
Quoted 14 lines
in
mic_pre_enable,pm_runtime_get_syncis called which increments the counter even in case of failure, leading to incorrect ref count. In case of failure, decrement the ref count before returning.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_mic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0drivers/gpu/drm/exynos/exynos_drm_mic.c static void mic_pre_enable(struct drm_bridge *bridge) · line 273
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +1
-1@@ -270,7 +270,7 @@ static void mic_pre_enable(struct drm_bridge *bridge) ret =pm_runtime_get_sync (mic->dev);if (ret <0 ) - goto unlock; + goto turn_off;How about just calling
pm_runtime_put_noidle()?
Quoted 5 lines
if (ret < 0) {
pm_runtime_put_noidle(mic->dev);
goto unlock;
}v2 was sent.
Quoted 7 lines
Thanks,
Inki DaeQuoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_mic.c +0
-0mic_set_path (mic,1 );
Signature · 1 line
Navid.