Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1403760 > unrolled thread
| Started by | Muhammad Falak R Wani <falakreyaz@gmail.com> |
|---|---|
| First post | 2016-05-19 16:00 +0200 |
| Last post | 2016-05-21 02:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] ps3_gelic: use kmemdup Muhammad Falak R Wani <falakreyaz@gmail.com> - 2016-05-19 16:00 +0200
Re: [PATCH] ps3_gelic: use kmemdup David Miller <davem@davemloft.net> - 2016-05-21 02:00 +0200
| From | Muhammad Falak R Wani <falakreyaz@gmail.com> |
|---|---|
| Date | 2016-05-19 16:00 +0200 |
| Subject | [PATCH] ps3_gelic: use kmemdup |
| Message-ID | <rAwEx-vI-11@gated-at.bofh.it> |
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. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> --- drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c index 743b182..446ea58 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c @@ -1616,13 +1616,13 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl) target->valid = 1; target->eurus_index = i; kfree(target->hwinfo); - target->hwinfo = kzalloc(be16_to_cpu(scan_info->size), + target->hwinfo = kmemdup(scan_info, + be16_to_cpu(scan_info->size), GFP_KERNEL); if (!target->hwinfo) continue; /* copy hw scan info */ - memcpy(target->hwinfo, scan_info, be16_to_cpu(scan_info->size)); target->essid_len = strnlen(scan_info->essid, sizeof(scan_info->essid)); target->rate_len = 0; -- 1.9.1
[toc] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2016-05-21 02:00 +0200 |
| Message-ID | <rB2uJ-4fX-9@gated-at.bofh.it> |
| In reply to | #1403760 |
From: Muhammad Falak R Wani <falakreyaz@gmail.com> Date: Thu, 19 May 2016 19:24:41 +0530 > 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. > > Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Applied.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web