linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()
@ 2021-03-23 11:29 'w00385741
  2021-03-27 14:39 ` Mirela Rabulea
  0 siblings, 1 reply; 2+ messages in thread
From: 'w00385741 @ 2021-03-23 11:29 UTC (permalink / raw)
  To: weiyongjun1, Mirela Rabulea, Mauro Carvalho Chehab, Shawn Guo,
	Sascha Hauer
  Cc: linux-media, linux-arm-kernel, kernel-janitors, Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

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>
---
 drivers/media/platform/imx-jpeg/mxc-jpeg.c | 4 ++--
 1 file 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 2d29558f1864..9509eb9d939a 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;
 		}
 	}


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

* Re: [PATCH -next] media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains()
  2021-03-23 11:29 [PATCH -next] media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains() 'w00385741
@ 2021-03-27 14:39 ` Mirela Rabulea
  0 siblings, 0 replies; 2+ messages in thread
From: Mirela Rabulea @ 2021-03-27 14:39 UTC (permalink / raw)
  To: s.hauer, mchehab, shawnguo, weiyongjun1
  Cc: linux-arm-kernel, linux-media, hulkci, kernel-janitors

Hi,
On Tue, 2021-03-23 at 11:29 +0000, 'w00385741 wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> 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>
> ---
>  drivers/media/platform/imx-jpeg/mxc-jpeg.c | 4 ++--
>  1 file 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 2d29558f1864..9509eb9d939a 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;
>  		}
>  	}
> 
Thanks for the patch.

Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>

Regards,
Mirela

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

end of thread, other threads:[~2021-03-27 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 11:29 [PATCH -next] media: imx-jpeg: Fix return value check in mxc_jpeg_attach_pm_domains() 'w00385741
2021-03-27 14:39 ` Mirela Rabulea

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).