From: Markus Elfring Date: Sat, 14 Jan 2017 21:15:54 +0000 (+0100) Subject: selinux: Return directly after a failed kzalloc() in type_read() X-Git-Tag: v4.14-rc2~6^2~112^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=549fe69ee5c7a7f55c34555032961a2265e6e713;p=platform%2Fkernel%2Flinux-exynos.git selinux: Return directly after a failed kzalloc() in type_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 9a90953..fd58de5 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c @@ -1469,10 +1469,9 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp) __le32 buf[4]; u32 len; - rc = -ENOMEM; typdatum = kzalloc(sizeof(*typdatum), GFP_KERNEL); if (!typdatum) - goto bad; + return -ENOMEM; if (p->policyvers >= POLICYDB_VERSION_BOUNDARY) to_read = 4;