projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7683eb
)
USB: storage: ene_ub6250: Use kmemdup instead of kmalloc + memcpy
author
Benoit Taine
<
[email protected]
>
Mon, 26 May 2014 15:21:10 +0000
(17:21 +0200)
committer
Greg Kroah-Hartman
<
[email protected]
>
Tue, 27 May 2014 23:23:44 +0000
(16:23 -0700)
This issue was reported by coccicheck using the semantic patch
at scripts/coccinelle/api/memdup.cocci
Signed-off-by: Benoit Taine <
[email protected]
>
Signed-off-by: Greg Kroah-Hartman <
[email protected]
>
drivers/usb/storage/ene_ub6250.c
patch
|
blob
|
history
diff --git
a/drivers/usb/storage/ene_ub6250.c
b/drivers/usb/storage/ene_ub6250.c
index 1bfc9a6cab5f7fad815b8f92feb5b50e7adceba8..ef6efb55dc312f2c482b52731053be317d16c582 100644
(file)
--- a/
drivers/usb/storage/ene_ub6250.c
+++ b/
drivers/usb/storage/ene_ub6250.c
@@
-1928,11
+1928,10
@@
static int ene_load_bincode(struct us_data *us, unsigned char flag)
usb_stor_dbg(us, "load firmware %s failed\n", fw_name);
goto nofw;
}
- buf = km
alloc(
sd_fw->size, GFP_KERNEL);
+ buf = km
emdup(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;