diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-10-23 16:17:21 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-29 18:33:06 -0500 |
commit | bed8bdfddd851657cf9e5fd16bb44abb02ae7f42 (patch) | |
tree | ac021f613071dc4a274d071ea900709cd4e17374 /drivers/infiniband/core/ucm.c | |
parent | a1a733f65b091fdad3d0783e648c92b491933ab6 (diff) |
IB: kmemdup() cleanup
Replace open coded kmemdup() to save some screen space, and allow
inlining/not inlining to be triggered by gcc.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/ucm.c')
-rw-r--r-- | drivers/infiniband/core/ucm.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index ad4f4d5c292..b4894ba223b 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -328,20 +328,18 @@ static int ib_ucm_event_process(struct ib_cm_event *evt, | |||
328 | } | 328 | } |
329 | 329 | ||
330 | if (uvt->data_len) { | 330 | if (uvt->data_len) { |
331 | uvt->data = kmalloc(uvt->data_len, GFP_KERNEL); | 331 | uvt->data = kmemdup(evt->private_data, uvt->data_len, GFP_KERNEL); |
332 | if (!uvt->data) | 332 | if (!uvt->data) |
333 | goto err1; | 333 | goto err1; |
334 | 334 | ||
335 | memcpy(uvt->data, evt->private_data, uvt->data_len); | ||
336 | uvt->resp.present |= IB_UCM_PRES_DATA; | 335 | uvt->resp.present |= IB_UCM_PRES_DATA; |
337 | } | 336 | } |
338 | 337 | ||
339 | if (uvt->info_len) { | 338 | if (uvt->info_len) { |
340 | uvt->info = kmalloc(uvt->info_len, GFP_KERNEL); | 339 | uvt->info = kmemdup(info, uvt->info_len, GFP_KERNEL); |
341 | if (!uvt->info) | 340 | if (!uvt->info) |
342 | goto err2; | 341 | goto err2; |
343 | 342 | ||
344 | memcpy(uvt->info, info, uvt->info_len); | ||
345 | uvt->resp.present |= IB_UCM_PRES_INFO; | 343 | uvt->resp.present |= IB_UCM_PRES_INFO; |
346 | } | 344 | } |
347 | return 0; | 345 | return 0; |