aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSilviu-Mihai Popescu <silviupopescu1990@gmail.com>2013-03-11 12:22:32 -0400
committerSteve French <smfrench@gmail.com>2013-05-04 23:08:19 -0400
commitf7f7c1850eb98da758731ea7edfa830ebefe24cd (patch)
tree78e8199747533ec4b78e27fd739ea68ebf13a171 /fs/cifs/cifssmb.c
parentd455b72bdd23a1d7adcbdfb5c1ceabcd7beaf853 (diff)
fs: cifs: use kmemdup instead of kmalloc + memcpy
This replaces calls to kmalloc followed by memcpy with a single call to kmemdup. This was found via make coccicheck. Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 8e2e799e7a24..1e7a4fe1f810 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -3742,12 +3742,11 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3742 rc = -EINVAL; 3742 rc = -EINVAL;
3743 *pbuflen = 0; 3743 *pbuflen = 0;
3744 } else { 3744 } else {
3745 *acl_inf = kmalloc(*pbuflen, GFP_KERNEL); 3745 *acl_inf = kmemdup(pdata, *pbuflen, GFP_KERNEL);
3746 if (*acl_inf == NULL) { 3746 if (*acl_inf == NULL) {
3747 *pbuflen = 0; 3747 *pbuflen = 0;
3748 rc = -ENOMEM; 3748 rc = -ENOMEM;
3749 } 3749 }
3750 memcpy(*acl_inf, pdata, *pbuflen);
3751 } 3750 }
3752 } 3751 }
3753qsec_out: 3752qsec_out: