Skip to content

Commit a4b1d1b

Browse files
thomasmeyaegl
authored andcommitted
ia64: pcibr: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent b82a3ec commit a4b1d1b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎arch/ia64/sn/pci/pcibr/pcibr_provider.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,11 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
127127
* Allocate kernel bus soft and copy from prom.
128128
*/
129129

130-
soft = kmalloc(sizeof(struct pcibus_info), GFP_KERNEL);
130+
soft = kmemdup(prom_bussoft, sizeof(struct pcibus_info), GFP_KERNEL);
131131
if (!soft) {
132132
return NULL;
133133
}
134134

135-
memcpy(soft, prom_bussoft, sizeof(struct pcibus_info));
136135
soft->pbi_buscommon.bs_base = (unsigned long)
137136
ioremap(REGION_OFFSET(soft->pbi_buscommon.bs_base),
138137
sizeof(struct pic));

0 commit comments

Comments
 (0)