]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/pci-sysfs.c
[POWERPC] Convert media-bay.c to use the kthread API
[linux-2.6-omap-h63xx.git] / drivers / pci / pci-sysfs.c
index 10dbdec80416dc69ce9272e37c0fbe7127d328a6..7d1877341aada287783065bf15ab9f6349b2b07a 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/stat.h>
 #include <linux/topology.h>
 #include <linux/mm.h>
-
+#include <linux/capability.h>
 #include "pci.h"
 
 static int sysfs_initialized;  /* = 0 */
@@ -702,8 +702,10 @@ static int __init pci_sysfs_init(void)
        sysfs_initialized = 1;
        for_each_pci_dev(pdev) {
                retval = pci_create_sysfs_dev_files(pdev);
-               if (retval)
+               if (retval) {
+                       pci_dev_put(pdev);
                        return retval;
+               }
        }
 
        return 0;