linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: mtk-vcodec: Fix an error handling path in 'asid_allocator_init()'
@ 2021-11-11 13:17 Christophe JAILLET
  2021-11-12  1:34 ` Tzung-Bi Shih
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-11-11 13:17 UTC (permalink / raw)
  To: tiffany.lin, andrew-ct.chen, mchehab, matthias.bgg, acourbot,
	yunfei.dong, hverkuil-cisco, tzungbi
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	kernel-janitors, Christophe JAILLET

In case of error the 'media_device_init()' call is not balanced by a
corresponding 'media_device_cleanup()' call.

Add it, when needed, as already done in the remove function.

Fixes: 118add98f80e ("media: mtk-vcodec: vdec: add media device if using stateless api")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
index e6e6a8203eeb..8277c44209b5 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
@@ -358,6 +358,8 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
 	if (dev->vdec_pdata->uses_stateless_api)
 		v4l2_m2m_unregister_media_controller(dev->m2m_dev_dec);
 err_reg_cont:
+	if (dev->vdec_pdata->uses_stateless_api)
+		media_device_cleanup(&dev->mdev_dec);
 	destroy_workqueue(dev->decode_workqueue);
 err_event_workq:
 	v4l2_m2m_release(dev->m2m_dev_dec);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: mtk-vcodec: Fix an error handling path in 'asid_allocator_init()'
  2021-11-11 13:17 [PATCH] media: mtk-vcodec: Fix an error handling path in 'asid_allocator_init()' Christophe JAILLET
@ 2021-11-12  1:34 ` Tzung-Bi Shih
  0 siblings, 0 replies; 2+ messages in thread
From: Tzung-Bi Shih @ 2021-11-12  1:34 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: tiffany.lin, andrew-ct.chen, mchehab, matthias.bgg, acourbot,
	yunfei.dong, hverkuil-cisco, linux-media, linux-arm-kernel,
	linux-mediatek, linux-kernel, kernel-janitors

On Thu, Nov 11, 2021 at 02:17:51PM +0100, Christophe JAILLET wrote:
> In case of error the 'media_device_init()' call is not balanced by a
> corresponding 'media_device_cleanup()' call.
> 
> Add it, when needed, as already done in the remove function.
> 
> Fixes: 118add98f80e ("media: mtk-vcodec: vdec: add media device if using stateless api")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

The commit title looks incorrect: "asid_allocator_init".

Except that,
Acked-by: Tzung-Bi Shih <tzungbi@google.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-12  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-11 13:17 [PATCH] media: mtk-vcodec: Fix an error handling path in 'asid_allocator_init()' Christophe JAILLET
2021-11-12  1:34 ` Tzung-Bi Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).