cifs: Use kmemdup rather than duplicating its implementation
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
fs/cifs/cifs_spnego.c 2011-11-08 10:34:14.586074433 +0100 renamed from fs/cifs/cifs_spnego.c 2011-11-07 19:38:22.023802738 +0100 +1 -2
@@ -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;