lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 0191/1039] media: mtk-vcodec: Fix an error handling path in mtk_vcodec_probe()
    Date
    From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

    [ Upstream commit 615c6f28b9ad7efc9bfbef2cafc6a0c5bc0c21e0 ]

    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>
    Acked-by: Tzung-Bi Shih <tzungbi@google.com>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 e6e6a8203eebf..8277c44209b5b 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 @@ err_media_reg:
    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.34.1


    \
     
     \ /
      Last update: 2022-09-17 16:14    [W:4.023 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site