Skip to content

Commit

Permalink
cifs: add check for kmalloc in parse_dacl
Browse files Browse the repository at this point in the history
Exit from parse_dacl if no memory returned from the call to kmalloc.

Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
Stanislav Fomichev authored and Steve French committed Feb 6, 2011
1 parent 247ec9b commit 8132b65
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/cifs/cifsacl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8132b65

Please sign in to comment.