usb: Cocci spatch "memdup.spatch"
Subsystems (2)
PATCH 1/1 usb: Cocci spatch "memdup.spatch"
Signed-off-by Thomas Meyer <[email protected]>
---
drivers/usb/storage/ene_ub6250.c +1 -2
@@ -1928,11 +1928,10 @@ static int ene_load_bincode(struct us_dausb_stor_dbg (us,"load firmware %s failed\n" , fw_name); goto nofw; } - buf =kmalloc (sd_fw->size,GFP_KERNEL ); + buf =kmemdup (sd_fw->data, sd_fw->size,GFP_KERNEL );if (buf ==NULL ) goto nofw; -memcpy (buf, sd_fw->data, sd_fw->size);memset (bcb,0 ,sizeof (struct bulk_cb_wrap )); bcb->Signature =cpu_to_le32 (US_BULK_CB_SIGN ); bcb->DataTransferLength = sd_fw->size;