linux/drivers
Julia Lawall 13eea19213 drivers/net/ax88796.c: Return error code in failure
In this code, 0 is returned on 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>
@a@
identifier alloc;
identifier ret;
constant C;
expression x;
@@

x = alloc(...);
if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> }

@@
identifier f, a.alloc;
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = alloc(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-21 04:25:50 -07:00
..
accessibility
acpi
amba
ata
atm Drivers: atm: Makefile: replace the use of <module>-objs with <module>-y 2010-10-21 03:09:48 -07:00
auxdisplay
base
block
bluetooth Bluetooth: hci_uart: Fix typo in stats for sco tx 2010-10-12 12:44:53 -03:00
cdrom
char
clocksource
connector
cpufreq
cpuidle
crypto
dca
dio
dma
edac
eisa
firewire
firmware
gpio
gpu
hid
hwmon
i2c
ide
idle
ieee1394
ieee802154
infiniband infiniband: fix mlx4 kconfig dependency warning 2010-10-16 11:13:25 -07:00
input
isdn CAPI: Silence lockdep warning on get_capi_appl_by_nr usage 2010-10-21 04:25:49 -07:00
leds
lguest
macintosh
mca
md
media
memstick
message
mfd
misc
mmc
mtd
net drivers/net/ax88796.c: Return error code in failure 2010-10-21 04:25:50 -07:00
nubus
of
oprofile
parisc
parport
pci
pcmcia
platform
pnp
power
pps
ps3
rapidio
regulator
rtc
s390 vlan: Rename VLAN_GROUP_ARRAY_LEN to VLAN_N_VID. 2010-10-21 01:26:50 -07:00
sbus
scsi cnic: Defer iscsi connection cleanup 2010-10-14 10:45:54 -07:00
serial
sfi
sh
sn
spi
ssb
staging
tc
telephony
thermal
uio
usb
uwb
vhost
video
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile