android_kernel_xiaomi_sm8350/drivers/video
Julia Lawall 625fcaf973 drivers/video: add missing pci_dev_get
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>
2008-02-06 10:41:16 -08:00
..
aty drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
backlight
console fbcon: fix sparse warning about shadowing 'rotate' symbol 2008-02-06 10:41:16 -08:00
display
geode make video/geode/lxfb_core.c:geode_modedb[] static 2008-02-06 10:41:15 -08:00
i810 fix ! versus & precedence in various places 2008-02-06 10:40:59 -08:00
intelfb Remove pointless casts from void pointers 2008-02-06 10:41:01 -08:00
kyro
logo logo.c: get rid of mips_machgroup 2007-10-18 14:37:17 -07:00
matrox i2c: normal_i2c can be made const (remaining drivers) 2008-01-27 18:14:47 +01:00
mbx
nvidia fb: nvidiafb: Try harder at initial mode setting. 2008-02-06 10:41:16 -08:00
omap drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
pnx4008 define global BIT macro 2007-10-19 11:53:42 -07:00
riva
savage
sis drivers/video: remove unnecessary pci_dev_put 2008-02-06 10:41:15 -08:00
vermilion vermilion.c: use ALIGN(), not __ALIGN_MASK() 2008-02-06 10:41:16 -08:00
68328fb.c
acornfb.c
acornfb.h
amba-clcd.c
amifb.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
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 atmel_lcdfb: validate display timings 2008-02-06 10:41:15 -08:00
au1100fb.c au1100fb: fix modpost warnings 2007-10-18 14:37:17 -07:00
au1100fb.h
au1200fb.c
au1200fb.h
bf54x-lq043fb.c Remove pointless casts from void pointers 2008-02-06 10:41:01 -08:00
bt431.h
bt455.h
bw2.c
c2p.c
c2p.h
cfbcopyarea.c fbdev: copyarea function taught to fully support swapped pixel order in byte 2007-10-16 09:43:23 -07:00
cfbfillrect.c
cfbimgblt.c
cg3.c
cg6.c
cg14.c
chipsfb.c
cirrusfb.c cirrusfb nonsense 2007-10-27 22:18:12 -07:00
clps711xfb.c
controlfb.c
controlfb.h
cyber2000fb.c [ARM] 4645/1: Cyberpro: Trivial fix to restore 16bpp mode. 2007-11-08 23:29:36 +00:00
cyber2000fb.h
cyblafb.c drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
dnfb.c
edid.h
efifb.c x86_64 EFI boot support: EFI frame buffer driver 2007-11-29 09:24:54 -08:00
epson1355fb.c
fb_ddc.c fb_ddc: fix DDC lines quirk 2007-11-29 09:24:52 -08:00
fb_defio.c fb: defio nopage 2008-02-06 10:41:15 -08:00
fb_draw.h fbdev: copyarea function taught to fully support swapped pixel order in byte 2007-10-16 09:43:23 -07:00
fb_notify.c
fb_sys_fops.c
fbcmap.c
fbcvt.c
fbmem.c fb: move and rename extern declaration for global_mode_option 2007-10-16 09:43:22 -07:00
fbmon.c fbmon: cleanup trailing whitespaces 2008-02-06 10:41:15 -08:00
fbsysfs.c
ffb.c
fm2fb.c
g364fb.c
gbefb.c gbefb: fix section mismatch warnings 2007-11-14 18:45:42 -08:00
gxt4500.c Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
hecubafb.c
hgafb.c
hitfb.c
hpfb.c video/hpfb.c section fix 2008-02-06 10:41:15 -08:00
igafb.c drivers/video: add missing pci_dev_get 2008-02-06 10:41:16 -08:00
imacfb.c imacfb: remove reference to otherwise-unused, non-existent screen_info.imacpm_seg 2007-11-29 09:24:53 -08:00
imsttfb.c
imxfb.c imxfb: fast read flag and nonstandard field configurable 2007-10-16 09:43:21 -07:00
imxfb.h
Kconfig [ARM] 4764/1: [AT91] AT91CAP9 core support 2008-01-26 15:01:13 +00:00
leo.c
macfb.c
macmodes.c
macmodes.h
Makefile x86_64 EFI boot support: EFI frame buffer driver 2007-11-29 09:24:54 -08:00
maxinefb.c
modedb.c fix radeonfb regression with Xpress 200m 5955 2008-01-17 15:38:59 -08:00
neofb.c neofb: avoid overwriting fb_info fields 2008-02-06 10:41:16 -08:00
offb.c
output.c
p9100.c
platinumfb.c
platinumfb.h
pm2fb.c
pm3fb.c drivers/video/pm3fb.c section fix 2008-02-06 10:41:16 -08:00
pmag-aa-fb.c
pmag-ba-fb.c drivers/video/pmag-ba-fb.c: improve diagnostics 2007-10-16 09:43:19 -07:00
pmagb-b-fb.c pmagb-b-fb: improve diagnostics 2007-10-16 09:43:20 -07:00
ps3fb.c ps3fb: fix deadlock on kexec() 2008-01-11 11:47:43 -08:00
pvr2fb.c
pxafb.c
pxafb.h
q40fb.c
s1d13xxxfb.c drivers/video/s1d13xxxfb.c: fix build as module with dbg 2007-11-14 18:45:38 -08:00
s3c2410fb.c s3c2410_fb: fix line length calculation 2008-01-21 19:39:41 -08:00
s3c2410fb.h
s3fb.c s3fb: do not allow incorrect pixclock settings 2007-10-16 09:43:23 -07:00
sa1100fb.c
sa1100fb.h
sbuslib.c
sbuslib.h
sgivwfb.c
skeletonfb.c
sm501fb.c drivers/video/: Spelling fixes 2008-02-03 17:31:49 +02:00
sstfb.c
sticore.h
stifb.c
sunxvr500.c
sunxvr2500.c
svgalib.c svgalib: mode selection updates 2007-10-16 09:43:22 -07:00
syscopyarea.c
sysfillrect.c
sysimgblt.c
tcx.c
tdfxfb.c tdfxfb: fix section mismatch warnings 2008-02-06 10:41:16 -08:00
tgafb.c tgafb: remove a redundant non-mono test in mono imageblit 2007-10-16 09:43:23 -07:00
tridentfb.c
uvesafb.c uvesafb: small cleanups 2008-02-06 10:41:16 -08:00
valkyriefb.c
valkyriefb.h
vesafb.c
vfb.c
vga16fb.c Remove magic macros for screen_info structure members 2007-10-16 22:57:17 -07:00
vgastate.c
vt8623fb.c
w100fb.c
w100fb.h
xilinxfb.c