]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
drivers/usb/class/usblp.c: adjust error handling code
authorJulia Lawall <julia@diku.dk>
Wed, 16 Jul 2008 16:00:42 +0000 (18:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Oct 2008 21:40:51 +0000 (14:40 -0700)
commit49b707b90c7f7260beb8691fc5d99d71a5549ec0
tree168692010834d1ec378cf8b7810159a7bebf85a8
parent5b775f672cc993ba9dba5626811ab1f2ac42883b
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: Julia Lawall <julia@diku.dk>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/usblp.c