lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 194/243] media: vimc: fix start stream when link is disabled
    Date
    From: Helen Fornazier <helen.koike@collabora.com>

    [ Upstream commit e159b6074c82fe31b79aad672e02fa204dbbc6d8 ]

    If link is disabled, media_entity_remote_pad returns NULL, causing a
    NULL pointer deference.
    Ignore links that are not enabled instead.

    Signed-off-by: Helen Koike <helen.koike@collabora.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/media/platform/vimc/vimc-common.c | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c
    index 204aa6f554e4d..fa8435ac2b1ae 100644
    --- a/drivers/media/platform/vimc/vimc-common.c
    +++ b/drivers/media/platform/vimc/vimc-common.c
    @@ -241,6 +241,8 @@ int vimc_pipeline_s_stream(struct media_entity *ent, int enable)

    /* Start the stream in the subdevice direct connected */
    pad = media_entity_remote_pad(&ent->pads[i]);
    + if (!pad)
    + continue;

    if (!is_media_entity_v4l2_subdev(pad->entity))
    return -EINVAL;
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-12-11 16:26    [W:5.223 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site