diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 15:20:43 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 09:54:48 -0400 |
commit | 7f6d0ad8b771a4936f448180de3bbfad92be34dc (patch) | |
tree | f89536bb940bc062bc704cdf503f5f23159958b8 /security | |
parent | 9c312e79d6afb673114ebe7aabd5594e79827eea (diff) |
selinux: Return directly after a failed kzalloc() in cat_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 a8389396e9a9..36285d12c2e9 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -1637,10 +1637,9 @@ static int cat_read(struct policydb *p, struct hashtab *h, void *fp) | |||
1637 | __le32 buf[3]; | 1637 | __le32 buf[3]; |
1638 | u32 len; | 1638 | u32 len; |
1639 | 1639 | ||
1640 | rc = -ENOMEM; | ||
1641 | catdatum = kzalloc(sizeof(*catdatum), GFP_ATOMIC); | 1640 | catdatum = kzalloc(sizeof(*catdatum), GFP_ATOMIC); |
1642 | if (!catdatum) | 1641 | if (!catdatum) |
1643 | goto bad; | 1642 | return -ENOMEM; |
1644 | 1643 | ||
1645 | rc = next_entry(buf, fp, sizeof buf); | 1644 | rc = next_entry(buf, fp, sizeof buf); |
1646 | if (rc) | 1645 | if (rc) |