* - drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch removed from -mm tree
@ 2008-12-03 6:55 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2008-12-03 6:55 UTC (permalink / raw)
To: julia, dwmw2, mm-commits
The patch titled
drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
has been removed from the -mm tree. Its filename was
drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch
This patch was dropped because an updated version will be merged
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
From: Julia Lawall <julia@diku.dk>
pci_get_device increments a reference count that should be decremented
using pci_dev_put. I have thus added an extra label in the error handling
code to do this. I don't know, however, whether there should be a
pci_dev_put before the return 0 as well.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S,S1;
position p1,p2,p3;
expression E,E1;
type T,T1;
expression *ptr != NULL;
@@
(
if ((x@p1 = pci_get_device(...)) == NULL) S
|
x@p1 = pci_get_device(...);
)
... when != pci_dev_put(...,(T)x,...)
when != if (...) { <+... pci_dev_put(...,(T)x,...) ...+> }
when != true x == NULL || ...
when != x = E
when != E = (T)x
when any
(
if (x == NULL || ...) S1
|
if@p2 (...) {
... when != pci_dev_put(...,(T1)x,...)
when != if (...) { <+... pci_dev_put(...,(T1)x,...) ...+> }
when != x = E1
when != E1 = (T1)x
(
return \(0\|<+...x...+>\|ptr\);
|
return@p3 ...;
)
}
)
@ script:python @
p1 << r.p1;
p3 << r.p3;
@@
print "* file: %s pci_get_device: %s return: %s" % (p1[0].file,p1[0].line,p3[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/mtd/nand/pasemi_nand.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff -puN drivers/mtd/nand/pasemi_nand.c~drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put drivers/mtd/nand/pasemi_nand.c
--- a/drivers/mtd/nand/pasemi_nand.c~drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put
+++ a/drivers/mtd/nand/pasemi_nand.c
@@ -144,7 +144,7 @@ static int __devinit pasemi_nand_probe(s
if (!request_region(lpcctl, 4, driver_name)) {
err = -EBUSY;
- goto out_ior;
+ goto out_pdev;
}
chip->cmd_ctrl = pasemi_hwcontrol;
@@ -176,6 +176,8 @@ static int __devinit pasemi_nand_probe(s
out_lpc:
release_region(lpcctl, 4);
+ out_pdev:
+ pci_dev_put(pdev);
out_ior:
iounmap(chip->IO_ADDR_R);
out_mtd:
_
Patches currently in -mm which might be from julia@diku.dk are
linux-next.patch
drivers-char-agp-add-missing-pci_dev_get.patch
arch-arm-eliminate-null-test-and-memset-after-alloc_bootmem.patch
arch-avr32-eliminate-null-test-and-memset-after-alloc_bootmem.patch
arch-powerpc-eliminate-null-test-and-memset-after-alloc_bootmem.patch
drivers-media-video-cx88-cx88-alsac-adjust-error-handling-code.patch
arch-ia64-eliminate-null-test-and-memset-after-alloc_bootmem.patch
drivers-mtd-maps-nettelc-use-array_size.patch
drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch
net-tipc-bcasth-use-array_size.patch
drivers-isdn-misdn-use-array_size.patch
fs-namespacec-drop-code-after-return.patch
mm-page_allocc-eliminate-null-test-and-memset-after-alloc_bootmem.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
* - drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch removed from -mm tree
@ 2008-12-07 0:05 akpm
0 siblings, 0 replies; 2+ messages in thread
From: akpm @ 2008-12-07 0:05 UTC (permalink / raw)
To: julia, dwmw2, mm-commits
The patch titled
drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
has been removed from the -mm tree. Its filename was
drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch
This patch was dropped because it was merged into mainline or a subsystem tree
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
From: Julia Lawall <julia@diku.dk>
pci_get_device increments a reference count that should be decremented
using pci_dev_put.
The semantic patch that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S,S1;
position p1,p2,p3;
expression E,E1;
type T,T1;
expression *ptr != NULL;
@@
(
if ((x@p1 = pci_get_device(...)) == NULL) S
|
x@p1 = pci_get_device(...);
)
... when != pci_dev_put(...,(T)x,...)
when != if (...) { <+... pci_dev_put(...,(T)x,...) ...+> }
when != true x == NULL || ...
when != x = E
when != E = (T)x
when any
(
if (x == NULL || ...) S1
|
if@p2 (...) {
... when != pci_dev_put(...,(T1)x,...)
when != if (...) { <+... pci_dev_put(...,(T1)x,...) ...+> }
when != x = E1
when != E1 = (T1)x
(
return \(0\|<+...x...+>\|ptr\);
|
return@p3 ...;
)
}
)
@ script:python @
p1 << r.p1;
p3 << r.p3;
@@
print "* file: %s pci_get_device: %s return: %s" % (p1[0].file,p1[0].line,p3[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/mtd/nand/pasemi_nand.c | 1 +
1 file changed, 1 insertion(+)
diff -puN drivers/mtd/nand/pasemi_nand.c~drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put drivers/mtd/nand/pasemi_nand.c
--- a/drivers/mtd/nand/pasemi_nand.c~drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put
+++ a/drivers/mtd/nand/pasemi_nand.c
@@ -141,6 +141,7 @@ static int __devinit pasemi_nand_probe(s
}
lpcctl = pci_resource_start(pdev, 0);
+ pci_dev_put(pdev);
if (!request_region(lpcctl, 4, driver_name)) {
err = -EBUSY;
_
Patches currently in -mm which might be from julia@diku.dk are
linux-next.patch
arch-arm-eliminate-null-test-and-memset-after-alloc_bootmem.patch
arch-avr32-eliminate-null-test-and-memset-after-alloc_bootmem.patch
drivers-media-video-cx88-cx88-alsac-adjust-error-handling-code.patch
arch-ia64-eliminate-null-test-and-memset-after-alloc_bootmem.patch
drivers-mtd-maps-nettelc-use-array_size.patch
net-tipc-bcasth-use-array_size.patch
drivers-isdn-misdn-use-array_size.patch
fs-namespacec-drop-code-after-return.patch
mm-page_allocc-eliminate-null-test-and-memset-after-alloc_bootmem.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-07 0:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-07 0:05 - drivers-mtd-nand-pasemi_nandc-add-missing-pci_dev_put.patch removed from -mm tree akpm
-- strict thread matches above, loose matches on Subject: below --
2008-12-03 6:55 akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.