]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
i7core_edac: Call pci_dev_put() when alloc_i7core_dev() failed
authorHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Fri, 20 Aug 2010 07:28:51 +0000 (04:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 24 Oct 2010 13:20:40 +0000 (11:20 -0200)
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/edac/i7core_edac.c

index 3542e8c0a63ff730cede594f4c91c8ead47eca84..2e2db3c083ed5d77eb8964ce385424a45d45bd3d 100644 (file)
@@ -1384,8 +1384,10 @@ static int i7core_get_onedevice(struct pci_dev **prev,
        i7core_dev = get_i7core_dev(socket);
        if (!i7core_dev) {
                i7core_dev = alloc_i7core_dev(socket, table);
-               if (!i7core_dev)
+               if (!i7core_dev) {
+                       pci_dev_put(pdev);
                        return -ENOMEM;
+               }
        }
 
        if (i7core_dev->pdev[devno]) {