diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 15:42:02 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 09:56:48 -0400 |
commit | 3c354d7d7bd5e788c3d94969e4a85648d29d9d12 (patch) | |
tree | e868a0dfef9f4c160adb4332957d0f9b5cdea7f9 /security | |
parent | 7f6d0ad8b771a4936f448180de3bbfad92be34dc (diff) |
selinux: Return directly after a failed kzalloc() in sens_read()
Return directly after a call of the function "kzalloc" failed
at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ss/policydb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 36285d12c2e9..aa1ce7ce3524 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -1595,10 +1595,9 @@ static int sens_read(struct policydb *p, struct hashtab *h, void *fp) | |||
1595 | __le32 buf[2]; | 1595 | __le32 buf[2]; |
1596 | u32 len; | 1596 | u32 len; |
1597 | 1597 | ||
1598 | rc = -ENOMEM; | ||
1599 | levdatum = kzalloc(sizeof(*levdatum), GFP_ATOMIC); | 1598 | levdatum = kzalloc(sizeof(*levdatum), GFP_ATOMIC); |
1600 | if (!levdatum) | 1599 | if (!levdatum) |
1601 | goto bad; | 1600 | return -ENOMEM; |
1602 | 1601 | ||
1603 | rc = next_entry(buf, fp, sizeof buf); | 1602 | rc = next_entry(buf, fp, sizeof buf); |
1604 | if (rc) | 1603 | if (rc) |