lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240514145807.GF32013@pendragon.ideasonboard.com>
Date: Tue, 14 May 2024 17:58:07 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
Cc: Philipp Zabel <p.zabel@...gutronix.de>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Michael Tretter <m.tretter@...gutronix.de>,
	linux-media@...r.kernel.org, imx@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	dan.carpenter@...aro.org, kernel-janitors@...r.kernel.org,
	error27@...il.com
Subject: Re: [PATCH v2] media: imx-pxp: fix ERR_PTR dereference in pxp_probe()

Hi Harshit,

Thank you for the patch.

On Tue, May 14, 2024 at 02:50:38AM -0700, Harshit Mogalapalli wrote:
> devm_regmap_init_mmio() can fail, add a check and bail out in case of
> error.
> 
> Fixes: 4e5bd3fdbeb3 ("media: imx-pxp: convert to regmap")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

> ---
> This is based on static analysis and only compile tested.
> v1->v2: fix error message, we dont need %d in dev_err_probe()
> ---
>  drivers/media/platform/nxp/imx-pxp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
> index e62dc5c1a4ae..e4427e6487fb 100644
> --- a/drivers/media/platform/nxp/imx-pxp.c
> +++ b/drivers/media/platform/nxp/imx-pxp.c
> @@ -1805,6 +1805,9 @@ static int pxp_probe(struct platform_device *pdev)
>  		return PTR_ERR(mmio);
>  	dev->regmap = devm_regmap_init_mmio(&pdev->dev, mmio,
>  					    &pxp_regmap_config);
> +	if (IS_ERR(dev->regmap))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(dev->regmap),
> +				     "Failed to init regmap\n");
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ