From: Markus Elfring Date: Sat, 14 Jan 2017 20:42:02 +0000 (+0100) Subject: selinux: Return directly after a failed kzalloc() in sens_read() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3c354d7d7bd5e788c3d94969e4a85648d29d9d12;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Paul Moore --- 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) __le32 buf[2]; u32 len; - rc = -ENOMEM; levdatum = kzalloc(sizeof(*levdatum), GFP_ATOMIC); if (!levdatum) - goto bad; + return -ENOMEM; rc = next_entry(buf, fp, sizeof buf); if (rc)