media: staging: tegra-vde: add missing pm_runtime_put_autosuspend
Subsystems (3)
PATCH 1/1 media: staging: tegra-vde: add missing pm_runtime_put_autosuspend
Call to pm_runtime_get_sync increments counter even in case of failure leading to incorrect ref count.
Call pm_runtime_put_autosuspend if pm_runtime_get_sync fails.
--- drivers/staging/media/tegra-vde/vde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/media/tegra-vde/vde.c +3 -1
@@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde, goto release_dpb_frames; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_autosuspend (dev); goto unlock; + }/* * We rely on the VDE registers reset value, otherwise VDE
Signature · 1 line
2.17.1
Jon Hunter
maintainerQuoted 15 lines · Navid Emamdoost
Call to
pm_runtime_get_syncincrements counter even in case of failure leading to incorrect ref count.
Callpm_runtime_put_autosuspendifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/staging/media/tegra-vde/vde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/media/tegra-vde/vde.c +0
-0@@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde, goto release_dpb_frames;
drivers/staging/media/tegra-vde/vde.c static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde, · line 785
Quoted 10 lines
drivers/staging/media/tegra-vde/vde.c +3
-1ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_autosuspend (dev); goto unlock; + }/* * We rely on the VDE registers reset value, otherwise VDE
Please use the put in the error path.
Jon
Signature · 1 line
nvpublic
05.06.2020 09:00, Jon Hunter пишет:
Quoted 25 lines · Navid Emamdoost
Quoted 23 lines
Call to
pm_runtime_get_syncincrements counter even in case of failure leading to incorrect ref count.
Callpm_runtime_put_autosuspendifpm_runtime_get_syncfails.Signed-off-by Navid Emamdoost <[email protected]>--- drivers/staging/media/tegra-vde/vde.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/staging/media/tegra-vde/vde.c +3
-1@@ -776,8 +776,10 @@ static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde, goto release_dpb_frames; ret =pm_runtime_get_sync (dev); -if (ret <0 ) +if (ret <0 ) { +pm_runtime_put_autosuspend (dev); goto unlock; + }
Quoted 4 lines
drivers/staging/media/tegra-vde/vde.c static int tegra_vde_ioctl_decode_h264(struct tegra_vde *vde, · line 785
Quoted 2 lines
drivers/staging/media/tegra-vde/vde.c +0
-0/* * We rely on the VDE registers reset value, otherwise VDE Please use the put in the error path.
This is a third version of the patch [1][2].
[1]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200514210847.9269-2-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org/
[2]
https://patchwork.ozlabs.org/project/linux-tegra/patch/20200520095148.10995-1-dinghao.liu-Y5EWUtBUdg4nDS1+zs4M5A@public.gmane.org/
I'd prefer to stick with my variant of the patch [1] because in my opinion it's most straightforward variant and I actually tested that it works properly.
Navid, anyways thank you for the patch. Next time please check if somebody else already sent similar patches before you.