]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pcmcia: omap: Add missing check for platform_get_resource
authorChen Ni <nichen@iscas.ac.cn>
Thu, 20 Mar 2025 06:39:56 +0000 (14:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 17:02:36 +0000 (19:02 +0200)
[ Upstream commit ecef14f70ec9344a10c817248d2ac6cddee5921e ]

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 <nichen@iscas.ac.cn>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pcmcia/omap_cf.c

index 1b1dff56ec7b11f3e7acb6bc16f5d80bac46a94f..441cdf83f5a4497b155432c435a2dc986de0247b 100644 (file)
@@ -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)