Julia Lawall 0d91f22b75 drivers/net/wireless/p54/eeprom.c: 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>
Cc: <stable@kernel.org>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-15 15:57:44 -04:00
..
2010-10-11 15:04:26 -04:00
2010-10-11 15:04:23 -04:00
2010-10-11 15:04:23 -04:00
2010-06-03 03:18:23 -07:00
2010-09-24 15:54:29 -04:00
2010-10-11 15:04:23 -04:00
2010-10-11 15:04:23 -04:00
2010-09-07 13:54:32 -04:00
2010-06-03 03:18:23 -07:00