memstick: Cocci spatch "memdup.spatch"
PATCH 1/1 memstick: Cocci spatch "memdup.spatch"
Signed-off-by Thomas Meyer <[email protected]>
---
drivers/memstick/core/mspro_block.c +1 -2
@@ -1032,12 +1032,11 @@ static int mspro_block_read_attributes(s } msb->attr_group.name ="media_attributes" ; - buffer =kmalloc (attr_len,GFP_KERNEL ); + buffer =kmemdup ((char *)attr, attr_len,GFP_KERNEL );if (!buffer) { rc = -ENOMEM ; goto out_free_attr; } -memcpy (buffer, (char *)attr, attr_len);for (cnt =0 ; cnt < attr_count; ++cnt) { s_attr =kzalloc (sizeof (struct mspro_sys_attr ),GFP_KERNEL );