From: Markus Elfring Date: Sat, 14 Jan 2017 20:20:43 +0000 (+0100) Subject: selinux: Return directly after a failed kzalloc() in cat_read() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=7f6d0ad8b771a4936f448180de3bbfad92be34dc;p=linux.git 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 Signed-off-by: Paul Moore --- diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index a8389396e9a95..36285d12c2e99 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) __le32 buf[3]; u32 len; - rc = -ENOMEM; catdatum = kzalloc(sizeof(*catdatum), GFP_ATOMIC); if (!catdatum) - goto bad; + return -ENOMEM; rc = next_entry(buf, fp, sizeof buf); if (rc)