Skip to content

Commit ecef14f

Browse files
Chen NiDominik Brodowski
authored andcommitted
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: 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>
1 parent 9e1ee33 commit ecef14f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)