i7core_edac: Call pci_dev_put() when alloc_i7core_dev() failed
Hidetoshi Seto [Fri, 20 Aug 2010 07:28:51 +0000 (04:28 -0300)]
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 3542e8c..2e2db3c 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]) {