[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1321089754.20155.128.camel@localhost.localdomain>
Date: Sat, 12 Nov 2011 10:22:34 +0100
From: Thomas Meyer <thomas@...3r.de>
To: linux-cifs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] cifs: Use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@...3r.de>
---
diff -u -p a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
--- a/fs/cifs/cifs_spnego.c 2011-11-07 19:38:22.023802738 +0100
+++ b/fs/cifs/cifs_spnego.c 2011-11-08 10:34:14.586074433 +0100
@@ -37,12 +37,11 @@ cifs_spnego_key_instantiate(struct key *
int ret;
ret = -ENOMEM;
- payload = kmalloc(datalen, GFP_KERNEL);
+ payload = kmemdup(data, datalen, GFP_KERNEL);
if (!payload)
goto error;
/* attach the data */
- memcpy(payload, data, datalen);
key->payload.data = payload;
ret = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists