diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-11-20 22:18:33 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:30:17 -0500 |
commit | b3ab09f9e1681916df349d54232fbb3f8a79bfa5 (patch) | |
tree | 3eb5667ee2efd5ea0355f881cb02898cd5658192 /net/irda/irias_object.c | |
parent | 8b2ed4bba45b7ca8e378d45f82f3f32f651e0a42 (diff) |
[IRDA]: Use kmemdup where applicable
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/irda/irias_object.c')
-rw-r--r-- | net/irda/irias_object.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 56292ab7d652..b1ee99a59c0c 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -501,13 +501,12 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
501 | len = IAS_MAX_OCTET_STRING; | 501 | len = IAS_MAX_OCTET_STRING; |
502 | value->len = len; | 502 | value->len = len; |
503 | 503 | ||
504 | value->t.oct_seq = kmalloc(len, GFP_ATOMIC); | 504 | value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); |
505 | if (value->t.oct_seq == NULL){ | 505 | if (value->t.oct_seq == NULL){ |
506 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); | 506 | IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); |
507 | kfree(value); | 507 | kfree(value); |
508 | return NULL; | 508 | return NULL; |
509 | } | 509 | } |
510 | memcpy(value->t.oct_seq, octseq , len); | ||
511 | return value; | 510 | return value; |
512 | } | 511 | } |
513 | 512 | ||
@@ -522,7 +521,6 @@ struct ias_value *irias_new_missing_value(void) | |||
522 | } | 521 | } |
523 | 522 | ||
524 | value->type = IAS_MISSING; | 523 | value->type = IAS_MISSING; |
525 | value->len = 0; | ||
526 | 524 | ||
527 | return value; | 525 | return value; |
528 | } | 526 | } |