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/iwcm.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/iwcm.c')
-rw-r--r-- | drivers/infiniband/core/iwcm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c index c3fb304a4e86..2bbcfa5c6e27 100644 --- a/drivers/infiniband/core/iwcm.c +++ b/drivers/infiniband/core/iwcm.c | |||
@@ -140,10 +140,9 @@ static int copy_private_data(struct iwcm_id_private *cm_id_priv, | |||
140 | { | 140 | { |
141 | void *p; | 141 | void *p; |
142 | 142 | ||
143 | p = kmalloc(event->private_data_len, GFP_ATOMIC); | 143 | p = kmemdup(event->private_data, event->private_data_len, GFP_ATOMIC); |
144 | if (!p) | 144 | if (!p) |
145 | return -ENOMEM; | 145 | return -ENOMEM; |
146 | memcpy(p, event->private_data, event->private_data_len); | ||
147 | event->private_data = p; | 146 | event->private_data = p; |
148 | return 0; | 147 | return 0; |
149 | } | 148 | } |