625fcaf973
pci_get_device does a pci_dev_get, so pci_dev_put needs to be called in an error case The problem was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // <smpl> @exists@ type T1,T2; identifier E; statement S,S1; expression x1,x2,x3; expression test; int ret != 0; @@ struct pci_dev *E; ... ( E = \(pci_get_slot\|pci_get_device\|pci_get_bus_and_slot\)(...); if (E == NULL) S | if ((E = \(pci_get_slot\|pci_get_device\|pci_get_bus_and_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 (E == NULL) S1 | if (test) + { ( + pci_dev_put(E); return; | + pci_dev_put(E); return ret; ) + } | if (test) { ... when != pci_dev_put(...,(T2)E,...) when != if (E != NULL) { ... pci_dev_put(...,(T2)E,...); ...} when != x2 = (T2)E ( + pci_dev_put(E); return; | + pci_dev_put(E); return ret; ) } ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
aty | ||
backlight | ||
console | ||
display | ||
geode | ||
i810 | ||
intelfb | ||
kyro | ||
logo | ||
matrox | ||
mbx | ||
nvidia | ||
omap | ||
pnx4008 | ||
riva | ||
savage | ||
sis | ||
vermilion | ||
68328fb.c | ||
acornfb.c | ||
acornfb.h | ||
amba-clcd.c | ||
amifb.c | ||
arcfb.c | ||
arkfb.c | ||
asiliantfb.c | ||
atafb_iplan2p2.c | ||
atafb_iplan2p4.c | ||
atafb_iplan2p8.c | ||
atafb_mfb.c | ||
atafb_utils.h | ||
atafb.c | ||
atafb.h | ||
atmel_lcdfb.c | ||
au1100fb.c | ||
au1100fb.h | ||
au1200fb.c | ||
au1200fb.h | ||
bf54x-lq043fb.c | ||
bt431.h | ||
bt455.h | ||
bw2.c | ||
c2p.c | ||
c2p.h | ||
cfbcopyarea.c | ||
cfbfillrect.c | ||
cfbimgblt.c | ||
cg3.c | ||
cg6.c | ||
cg14.c | ||
chipsfb.c | ||
cirrusfb.c | ||
clps711xfb.c | ||
controlfb.c | ||
controlfb.h | ||
cyber2000fb.c | ||
cyber2000fb.h | ||
cyblafb.c | ||
dnfb.c | ||
edid.h | ||
efifb.c | ||
epson1355fb.c | ||
fb_ddc.c | ||
fb_defio.c | ||
fb_draw.h | ||
fb_notify.c | ||
fb_sys_fops.c | ||
fbcmap.c | ||
fbcvt.c | ||
fbmem.c | ||
fbmon.c | ||
fbsysfs.c | ||
ffb.c | ||
fm2fb.c | ||
g364fb.c | ||
gbefb.c | ||
gxt4500.c | ||
hecubafb.c | ||
hgafb.c | ||
hitfb.c | ||
hpfb.c | ||
igafb.c | ||
imacfb.c | ||
imsttfb.c | ||
imxfb.c | ||
imxfb.h | ||
Kconfig | ||
leo.c | ||
macfb.c | ||
macmodes.c | ||
macmodes.h | ||
Makefile | ||
maxinefb.c | ||
modedb.c | ||
neofb.c | ||
offb.c | ||
output.c | ||
p9100.c | ||
platinumfb.c | ||
platinumfb.h | ||
pm2fb.c | ||
pm3fb.c | ||
pmag-aa-fb.c | ||
pmag-ba-fb.c | ||
pmagb-b-fb.c | ||
ps3fb.c | ||
pvr2fb.c | ||
pxafb.c | ||
pxafb.h | ||
q40fb.c | ||
s1d13xxxfb.c | ||
s3c2410fb.c | ||
s3c2410fb.h | ||
s3fb.c | ||
sa1100fb.c | ||
sa1100fb.h | ||
sbuslib.c | ||
sbuslib.h | ||
sgivwfb.c | ||
skeletonfb.c | ||
sm501fb.c | ||
sstfb.c | ||
sticore.h | ||
stifb.c | ||
sunxvr500.c | ||
sunxvr2500.c | ||
svgalib.c | ||
syscopyarea.c | ||
sysfillrect.c | ||
sysimgblt.c | ||
tcx.c | ||
tdfxfb.c | ||
tgafb.c | ||
tridentfb.c | ||
uvesafb.c | ||
valkyriefb.c | ||
valkyriefb.h | ||
vesafb.c | ||
vfb.c | ||
vga16fb.c | ||
vgastate.c | ||
vt8623fb.c | ||
w100fb.c | ||
w100fb.h | ||
xilinxfb.c |