summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2025-03-20 14:39:56 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-09 19:02:36 +0200
commitafc07186508fd72ec3878500ae4dba55fe29e739 (patch)
tree76604b37c31bccdb8443b23fe957dcc26cfc50ac
parentbafcd9a0904c805c1dc5332a4fa4c5802de6ba24 (diff)
pcmcia: omap: Add missing check for platform_get_resource
[ 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>
-rw-r--r--drivers/pcmcia/omap_cf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index 1b1dff56ec7b..441cdf83f5a4 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)