Julia Lawall 7c81aafaf0 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>
2010-08-23 20:50:16 -07:00
..
2010-05-20 13:21:49 -07:00
2009-01-07 09:59:58 -08:00
2010-08-10 14:35:39 -07:00
2010-07-26 14:18:11 +02:00
2010-08-10 14:35:37 -07:00
2010-08-10 14:35:39 -07:00
2008-07-21 15:16:10 -07:00
2009-09-23 06:46:35 -07:00
2008-10-17 14:40:53 -07:00