From: Stanislav Fomichev Date: Sat, 5 Feb 2011 23:05:28 +0000 (+0300) Subject: cifs: add check for kmalloc in parse_dacl X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=8132b65bc6ce6d9a4baafdfc28c7cd9c258ed6e4;p=deliverable%2Flinux.git cifs: add check for kmalloc in parse_dacl Exit from parse_dacl if no memory returned from the call to kmalloc. Signed-off-by: Stanislav Fomichev Signed-off-by: Steve French --- diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 1e7636b145a8..beeebf194234 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c @@ -372,6 +372,10 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), GFP_KERNEL); + if (!ppace) { + cERROR(1, "DACL memory allocation error"); + return; + } for (i = 0; i < num_aces; ++i) { ppace[i] = (struct cifs_ace *) (acl_base + acl_size);