* [PATCH 3/4] drivers/usb/host/ohci-omap3.c: test the just-initialized value
@ 2011-08-22 14:00 Julia Lawall
2011-08-23 10:01 ` Felipe Balbi
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2011-08-22 14:00 UTC (permalink / raw)
To: Alan Stern
Cc: kernel-janitors, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
linux-omap, linux-kernel
From: Julia Lawall <julia@diku.dk>
Test the just-initialized value rather than some other one.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST};
statement S;
@@
x = f(...);
(
if (\(x == NULL\|IS_ERR(x)\)) S
|
*if (\(y == NULL\|IS_ERR(y)\))
{ ... when != x
return ...; }
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/usb/host/ohci-omap3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 6048f2f..853ad8d 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -149,7 +149,7 @@ static int __devinit ohci_hcd_omap3_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev,
IORESOURCE_MEM, "ohci");
- if (!ret) {
+ if (!res) {
dev_err(dev, "UHH OHCI get resource failed\n");
return -ENOMEM;
}
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 3/4] drivers/usb/host/ohci-omap3.c: test the just-initialized value
2011-08-22 14:00 [PATCH 3/4] drivers/usb/host/ohci-omap3.c: test the just-initialized value Julia Lawall
@ 2011-08-23 10:01 ` Felipe Balbi
0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2011-08-23 10:01 UTC (permalink / raw)
To: Julia Lawall
Cc: Alan Stern, kernel-janitors, Felipe Balbi, Greg Kroah-Hartman,
linux-usb, linux-omap, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
On Mon, Aug 22, 2011 at 04:00:35PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Test the just-initialized value rather than some other one.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST};
> statement S;
> @@
>
> x = f(...);
> (
> if (\(x == NULL\|IS_ERR(x)\)) S
> |
> *if (\(y == NULL\|IS_ERR(y)\))
> { ... when != x
> return ...; }
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
applied, thanks
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-23 10:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22 14:00 [PATCH 3/4] drivers/usb/host/ohci-omap3.c: test the just-initialized value Julia Lawall
2011-08-23 10:01 ` Felipe Balbi
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®