Skip to content

Commit afc0718

Browse files
Chen Nigregkh
authored andcommitted
pcmcia: omap: Add missing check for platform_get_resource
[ Upstream commit ecef14f ] Add missing check for platform_get_resource() and return error if it fails to catch the error. Fixes: d87d44f ("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>
1 parent bafcd9a commit afc0718

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/pcmcia/omap_cf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ static int __init omap_cf_probe(struct platform_device *pdev)
215215
return -EINVAL;
216216

217217
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
218+
if (!res)
219+
return -EINVAL;
218220

219221
cf = kzalloc(sizeof *cf, GFP_KERNEL);
220222
if (!cf)

0 commit comments

Comments
 (0)