diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-03-23 14:29:03 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-04-06 11:32:18 +0300 |
commit | d75b32853d4a89a8901991f294ff24b2f8fe1da5 (patch) | |
tree | eac51d4e9cd750aa5afed500bf83459620ecb671 /drivers/media/platform/imx-jpeg | |
parent | fb3b597abdcec889876669e5dea2a80ea0ddbdd0 (diff) | |
download | linux-d75b32853d4a89a8901991f294ff24b2f8fe1da5.tar.xz |
media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()
In case of error, the function device_link_add() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 2db16c6ed72c ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder")
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>
Diffstat (limited to 'drivers/media/platform/imx-jpeg')
-rw-r--r-- | drivers/media/platform/imx-jpeg/mxc-jpeg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c index 54c93ae6aae0..0419878feefd 100644 --- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c @@ -1943,8 +1943,8 @@ static int mxc_jpeg_attach_pm_domains(struct mxc_jpeg_dev *jpeg) DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE); - if (IS_ERR(jpeg->pd_link[i])) { - ret = PTR_ERR(jpeg->pd_link[i]); + if (!jpeg->pd_link[i]) { + ret = -EINVAL; goto fail; } } |