]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
selinux: Return directly after a failed kzalloc() in common_read()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 15 Jan 2017 10:15:19 +0000 (11:15 +0100)
committerPaul Moore <paul@paul-moore.com>
Wed, 29 Mar 2017 15:29:11 +0000 (11:29 -0400)
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>
security/selinux/ss/policydb.c

index edf173ed05f853aad78a720a10ac31f4fb2f671d..99ee0ee2d92afd256243a3250ac24c65e474a853 100644 (file)
@@ -1152,10 +1152,9 @@ static int common_read(struct policydb *p, struct hashtab *h, void *fp)
        u32 len, nel;
        int i, rc;
 
-       rc = -ENOMEM;
        comdatum = kzalloc(sizeof(*comdatum), GFP_KERNEL);
        if (!comdatum)
-               goto bad;
+               return -ENOMEM;
 
        rc = next_entry(buf, fp, sizeof buf);
        if (rc)