diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-01-14 22:08:22 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-03-29 17:15:17 +0200 |
commit | 4bd9f07b89f1a300f96b4863c3a8a4ec36991930 (patch) | |
tree | b1f0e2e98fb2991a6977a82cc8556a69ab07a5ad /security | |
parent | selinux: Improve another size determination in sens_read() (diff) | |
download | linux-4bd9f07b89f1a300f96b4863c3a8a4ec36991930.tar.xz linux-4bd9f07b89f1a300f96b4863c3a8a4ec36991930.zip |
selinux: Return directly after a failed kzalloc() in user_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 4759c22d1ae6..9a90953974b8 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1544,10 +1544,9 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp) __le32 buf[3]; u32 len; - rc = -ENOMEM; usrdatum = kzalloc(sizeof(*usrdatum), GFP_KERNEL); if (!usrdatum) - goto bad; + return -ENOMEM; if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) to_read = 3; |