sysfs: export the vfs release call of binary attribute
Initialize the allocated bin_attribute structure, otherwise unused fields are pointing to random places.
Signed-off-by Kay Sievers <[email protected]>
===== drivers/pci/pci-sysfs.c 1.16 vs edited =====
drivers/pci/pci-sysfs.c +1 -0
@@ -435,6 +435,7 @@ int pci_create_sysfs_dev_files (struct pstruct bin_attribute *rom_attr; rom_attr =kmalloc (sizeof (*rom_attr),GFP_ATOMIC ); +memset (rom_attr,0x00 ,sizeof (*rom_attr));if (rom_attr) { pdev->rom_attr = rom_attr; rom_attr->size =pci_resource_len (pdev,PCI_ROM_RESOURCE );
Quoted 2 lines · Kay Sievers
Initialize the allocated
bin_attributestructure, otherwise unused fields are pointing to random places.
Sorry, wrong place for the inititalization.
Signed-off-by Kay Sievers <[email protected]>
===== drivers/pci/pci-sysfs.c 1.16 vs edited =====
drivers/pci/pci-sysfs.c +1 -0
@@ -436,6 +436,7 @@ int pci_create_sysfs_dev_files (struct p rom_attr =kmalloc (sizeof (*rom_attr),GFP_ATOMIC );if (rom_attr) { +memset (rom_attr,0x00 ,sizeof (*rom_attr)); pdev->rom_attr = rom_attr; rom_attr->size =pci_resource_len (pdev,PCI_ROM_RESOURCE ); rom_attr->attr.name ="rom" ;
Greg KH
AppliedQuoted 7 lines · Kay Sievers
Quoted 2 lines · Kay Sievers
Initialize the allocated
bin_attributestructure, otherwise unused fields are pointing to random places.Sorry, wrong place for the inititalization.
Signed-off-by Kay Sievers <[email protected]>
Applied, thanks.
greg k-h