* [PATCH] pcmcia: omap: Add missing check for platform_get_resource
@ 2025-03-20 6:39 Chen Ni
2025-08-16 14:43 ` Dominik Brodowski
0 siblings, 1 reply; 2+ messages in thread
From: Chen Ni @ 2025-03-20 6:39 UTC (permalink / raw)
To: linux, tony, arnd; +Cc: linux-kernel, Chen Ni
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>
---
drivers/pcmcia/omap_cf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
index f0ccf479f36e..e0a3820acaef 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)
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] pcmcia: omap: Add missing check for platform_get_resource
2025-03-20 6:39 [PATCH] pcmcia: omap: Add missing check for platform_get_resource Chen Ni
@ 2025-08-16 14:43 ` Dominik Brodowski
0 siblings, 0 replies; 2+ messages in thread
From: Dominik Brodowski @ 2025-08-16 14:43 UTC (permalink / raw)
To: Chen Ni; +Cc: tony, arnd, linux-kernel
Am Thu, Mar 20, 2025 at 02:39:56PM +0800 schrieb Chen Ni:
> 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>
Applied to pcmcia-next, thanks.
Best,
Dominik
> ---
> drivers/pcmcia/omap_cf.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c
> index f0ccf479f36e..e0a3820acaef 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)
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-16 14:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-20 6:39 [PATCH] pcmcia: omap: Add missing check for platform_get_resource Chen Ni
2025-08-16 14:43 ` Dominik Brodowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®