diff options
author | Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> | 2024-05-14 02:50:38 -0700 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-06-26 09:14:02 +0300 |
commit | 57e9ce68ae98551da9c161aaab12b41fe8601856 (patch) | |
tree | 9bf349baf08f5c8feb72edf8574c30a8307647b8 /drivers/media | |
parent | bf9817d2ed3a499d4ec1a5125fb700185b2f2499 (diff) | |
download | linux-stable-57e9ce68ae98551da9c161aaab12b41fe8601856.tar.gz linux-stable-57e9ce68ae98551da9c161aaab12b41fe8601856.tar.bz2 linux-stable-57e9ce68ae98551da9c161aaab12b41fe8601856.zip |
media: imx-pxp: Fix ERR_PTR dereference in pxp_probe()
devm_regmap_init_mmio() can fail, add a check and bail out in case of
error.
Fixes: 4e5bd3fdbeb3 ("media: imx-pxp: convert to regmap")
Cc: stable@vger.kernel.org
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240514095038.3464191-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/nxp/imx-pxp.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) |