mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
mtd: pmcmsp: use kstrndup instead of kmalloc+strncpy
am: 7b767f6b51
Change-Id: I51e1de17cb27e46a91d8b5d973c7cf886fde8654
This commit is contained in:
@@ -139,15 +139,13 @@ static int __init init_msp_flash(void)
|
||||
}
|
||||
|
||||
msp_maps[i].bankwidth = 1;
|
||||
msp_maps[i].name = kmalloc(7, GFP_KERNEL);
|
||||
msp_maps[i].name = kstrndup(flash_name, 7, GFP_KERNEL);
|
||||
if (!msp_maps[i].name) {
|
||||
iounmap(msp_maps[i].virt);
|
||||
kfree(msp_parts[i]);
|
||||
goto cleanup_loop;
|
||||
}
|
||||
|
||||
msp_maps[i].name = strncpy(msp_maps[i].name, flash_name, 7);
|
||||
|
||||
for (j = 0; j < pcnt; j++) {
|
||||
part_name[5] = '0' + i;
|
||||
part_name[7] = '0' + j;
|
||||
|
||||
Reference in New Issue
Block a user