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 <kernel@fomichev.me>
Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
Stanislav Fomichev 2011-02-06 02:05:28 +03:00 committed by Steve French
parent 247ec9b418
commit 8132b65bc6

View File

@ -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);