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:
a831979
)
drivers/memstick/core/mspro_block: use kmemdup
author
Muhammad Falak R Wani
<
[email protected]
>
Mon, 23 May 2016 23:24:31 +0000
(16:24 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 24 May 2016 00:04:14 +0000
(17:04 -0700)
Use kmemdup when some other buffer is immediately copied into allocated
region. It replaces call to allocation followed by memcpy, by a single
call to kmemdup.
[
[email protected]
: remove unneeded cast to void*]
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Muhammad Falak R Wani <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/memstick/core/mspro_block.c
patch
|
blob
|
history
diff --git
a/drivers/memstick/core/mspro_block.c
b/drivers/memstick/core/mspro_block.c
index 922a750640e8684f9ddda9ca7a20bec44832b5b3..0fb27d3388110909e172a25750fce141d5cdd176 100644
(file)
--- a/
drivers/memstick/core/mspro_block.c
+++ b/
drivers/memstick/core/mspro_block.c
@@
-1033,12
+1033,11
@@
static int mspro_block_read_attributes(struct memstick_dev *card)
}
msb->attr_group.name = "media_attributes";
- buffer = km
alloc(
attr_len, GFP_KERNEL);
+ buffer = km
emdup(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);