lkml.org 
[lkml]   [2021]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 293/530] media: m88ds3103: fix return value check in m88ds3103_probe()
    Date
    From: Wei Yongjun <weiyongjun1@huawei.com>

    [ Upstream commit e61f9ea271933d987ab895c689fa37744f6fc27f ]

    In case of error, the function i2c_new_dummy_device() returns
    ERR_PTR() and never returns NULL. The NULL test in the return
    value check should be replaced with IS_ERR().

    Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod")
    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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/dvb-frontends/m88ds3103.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/media/dvb-frontends/m88ds3103.c b/drivers/media/dvb-frontends/m88ds3103.c
    index ad6d9d564a87..c120cffb52ad 100644
    --- a/drivers/media/dvb-frontends/m88ds3103.c
    +++ b/drivers/media/dvb-frontends/m88ds3103.c
    @@ -1904,8 +1904,8 @@ static int m88ds3103_probe(struct i2c_client *client,

    dev->dt_client = i2c_new_dummy_device(client->adapter,
    dev->dt_addr);
    - if (!dev->dt_client) {
    - ret = -ENODEV;
    + if (IS_ERR(dev->dt_client)) {
    + ret = PTR_ERR(dev->dt_client);
    goto err_kfree;
    }
    }
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-05-12 18:31    [W:2.684 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site