Files
linux/drivers
Julia Lawall 93f985f2dc drivers/net/wireless/p54/eeprom.c: Return -ENOMEM on memory allocation failure
commit 0d91f22b75 upstream.

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>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-22 11:03:07 -08:00
..
2010-10-08 22:37:46 -04:00
2010-09-28 23:30:38 -04:00
2010-10-13 15:43:10 -07:00
2010-10-08 10:21:22 -07:00
2010-09-19 22:43:42 -04:00
2010-08-24 15:28:28 +10:00
2010-10-07 12:02:50 +11:00
2010-09-26 15:54:25 +02:00
2010-06-16 18:08:32 +02:00
2010-09-16 11:48:48 -04:00
2010-06-01 12:04:35 -04:00
2010-11-22 11:03:06 -08:00
2010-06-16 18:05:05 +02:00
2010-09-22 16:21:33 +02:00
2010-07-26 08:05:31 -07:00