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-08-25 14:33:18 -04:00
2010-08-16 16:45:11 -04:00
2010-06-03 03:18:23 -07:00
2010-02-08 16:51:01 -05:00
2010-06-03 03:18:23 -07:00
2010-08-24 16:28:14 -04:00
2010-06-03 03:18:23 -07:00
2010-10-05 13:35:25 -04:00
2010-06-03 03:18:23 -07:00