From: Chen Ni Date: Thu, 20 Mar 2025 06:39:56 +0000 (+0800) Subject: pcmcia: omap: Add missing check for platform_get_resource X-Git-Tag: v6.17-rc5~20^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecef14f70ec9344a10c817248d2ac6cddee5921e;p=thirdparty%2Fkernel%2Fstable.git pcmcia: omap: Add missing check for platform_get_resource Add missing check for platform_get_resource() and return error if it fails to catch the error. Fixes: d87d44f7ab35 ("ARM: omap1: move CF chipselect setup to board file") Signed-off-by: Chen Ni Signed-off-by: Dominik Brodowski --- diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 733777367c3b4..d6f24c7d15622 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -215,6 +215,8 @@ static int __init omap_cf_probe(struct platform_device *pdev) return -EINVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; cf = kzalloc(sizeof *cf, GFP_KERNEL); if (!cf)