diff options
author | Julia Lawall <julia@diku.dk> | 2010-08-11 12:10:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-24 05:50:16 +0200 |
commit | 7c81aafaf059b81ead2330bc13db78269ef62612 (patch) | |
tree | 4e98fbe0298e523231fa6b7d470d640d364aa712 /drivers/usb/otg | |
parent | USB: gadget: fix composite kernel-doc warnings (diff) | |
download | linux-7c81aafaf059b81ead2330bc13db78269ef62612.tar.xz linux-7c81aafaf059b81ead2330bc13db78269ef62612.zip |
USB: gadget: Return -ENOMEM on memory allocation failure
In this code, 0 is returned on memory allocation failure, even though other
failures return -ENOMEM or other similar values.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression ret;
expression x,e1,e2,e3;
@@
ret = 0
... when != ret = e1
*x = \(kmalloc\|kcalloc\|kzalloc\)(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/otg')
0 files changed, 0 insertions, 0 deletions