From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Michael Tretter <m.tretter@pengutronix.de>,
linux-media@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dan.carpenter@linaro.org,
kernel-janitors@vger.kernel.org, error27@gmail.com
Subject: Re: [PATCH v2] media: imx-pxp: fix ERR_PTR dereference in pxp_probe()
Date: Tue, 14 May 2024 17:58:07 +0300 [thread overview]
Message-ID: <20240514145807.GF32013@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20240514095038.3464191-1-harshit.m.mogalapalli@oracle.com>
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@oracle.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.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
prev parent reply other threads:[~2024-05-14 14:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 9:50 [PATCH v2] media: imx-pxp: fix ERR_PTR dereference in pxp_probe() Harshit Mogalapalli
2024-05-14 14:58 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240514145807.GF32013@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=festevam@gmail.com \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=imx@lists.linux.dev \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.tretter@pengutronix.de \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).