From b3ab09f9e1681916df349d54232fbb3f8a79bfa5 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 21 Nov 2006 01:18:33 -0200 Subject: [IRDA]: Use kmemdup where applicable Signed-off-by: Arnaldo Carvalho de Melo --- net/irda/irias_object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'net/irda/irias_object.c') 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) len = IAS_MAX_OCTET_STRING; value->len = len; - value->t.oct_seq = kmalloc(len, GFP_ATOMIC); + value->t.oct_seq = kmemdup(octseq, len, GFP_ATOMIC); if (value->t.oct_seq == NULL){ IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__); kfree(value); return NULL; } - memcpy(value->t.oct_seq, octseq , len); return value; } @@ -522,7 +521,6 @@ struct ias_value *irias_new_missing_value(void) } value->type = IAS_MISSING; - value->len = 0; return value; } -- cgit v1.2.2