1523508d63
pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an error case. An extract of the semantic match used to find the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ type find1.T,T1,T2; identifier find1.E; statement find1.S; expression x1,x2,x3; expression find1.test; int ret != 0; @@ T E; ... ( * E = pci_get_slot(...); if (E == NULL) S | * if ((E = pci_get_slot(...)) == NULL) S ) ... when != pci_dev_put(...,(T1)E,...) when != if (E != NULL) { ... pci_dev_put(...,(T1)E,...); ...} when != x1 = (T1)E when != E = x3; when any if (test) { ... when != pci_dev_put(...,(T2)E,...) when != if (E != NULL) { ... pci_dev_put(...,(T2)E,...); ...} when != x2 = (T2)E ( * return; | * return ret; ) } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
at91_cf.c | ||
au1000_db1x00.c | ||
au1000_generic.c | ||
au1000_generic.h | ||
au1000_pb1x00.c | ||
au1000_xxs1500.c | ||
cardbus.c | ||
cirrus.h | ||
cistpl.c | ||
cs.c | ||
cs_internal.h | ||
ds.c | ||
ds_internal.h | ||
electra_cf.c | ||
hd64465_ss.c | ||
i82092.c | ||
i82092aa.h | ||
i82365.c | ||
i82365.h | ||
Kconfig | ||
m8xx_pcmcia.c | ||
m32r_cfc.c | ||
m32r_cfc.h | ||
m32r_pcc.c | ||
m32r_pcc.h | ||
Makefile | ||
o2micro.h | ||
omap_cf.c | ||
pcmcia_ioctl.c | ||
pcmcia_resource.c | ||
pd6729.c | ||
pd6729.h | ||
pxa2xx_base.c | ||
pxa2xx_base.h | ||
pxa2xx_cm_x270.c | ||
pxa2xx_lubbock.c | ||
pxa2xx_mainstone.c | ||
pxa2xx_sharpsl.c | ||
ricoh.h | ||
rsrc_mgr.c | ||
rsrc_nonstatic.c | ||
sa11xx_base.c | ||
sa11xx_base.h | ||
sa1100_assabet.c | ||
sa1100_badge4.c | ||
sa1100_cerf.c | ||
sa1100_generic.c | ||
sa1100_generic.h | ||
sa1100_h3600.c | ||
sa1100_jornada720.c | ||
sa1100_neponset.c | ||
sa1100_shannon.c | ||
sa1100_simpad.c | ||
sa1111_generic.c | ||
sa1111_generic.h | ||
soc_common.c | ||
soc_common.h | ||
socket_sysfs.c | ||
tcic.c | ||
tcic.h | ||
ti113x.h | ||
topic.h | ||
vg468.h | ||
vrc4171_card.c | ||
vrc4173_cardu.c | ||
vrc4173_cardu.h | ||
yenta_socket.c | ||
yenta_socket.h |