Skip to content
Commit 49b707b9 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman
Browse files

drivers/usb/class/usblp.c: adjust error handling code

In this code, it is possible to tell statically whether usblp will be NULL
in the error handling code.

Oliver Neukum suggested to make a goto to the final return rather than 
return directly.

The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/

)

// <smpl>
@@
identifier f,err,l,l1;
type T;
expression x,E;
statement S;
@@

x = NULL
... when != goto l1;
* x = f(...)
... when != x
err = E;
goto l;
...
* if (x != NULL)
  S
return err;
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5b775f67
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment