PCI: sysfs: Fix failure path for addition of "vpd" attribute
[pandora-kernel.git] / drivers / pci / pci-sysfs.c
index 8ecaac9..cf2b365 100644 (file)
@@ -1087,7 +1087,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
                attr->write = write_vpd_attr;
                retval = sysfs_create_bin_file(&dev->dev.kobj, attr);
                if (retval) {
-                       kfree(dev->vpd->attr);
+                       kfree(attr);
                        return retval;
                }
                dev->vpd->attr = attr;