[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <60b730d9-c683-a6ee-42fb-1c874ad86205@users.sourceforge.net>
Date: Thu, 19 Jan 2017 17:59:00 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linuxppc-dev@...ts.ozlabs.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Daniel Axtens <dja@...ens.net>,
Geliang Tang <geliangtang@....com>,
Michael Ellerman <mpe@...erman.id.au>,
Nathan Fontenot <nfont@...ux.vnet.ibm.com>,
Pan Xinhui <xinhui.pan@...ux.vnet.ibm.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Paul Mackerras <paulus@...ba.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 5/8] powerpc/nvram: Return directly after a failed kmalloc()
in dev_nvram_read()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 19 Jan 2017 16:50:31 +0100
Return directly after a call of the function "kmalloc" failed here.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
arch/powerpc/kernel/nvram_64.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 463551589b97..68b970bcf2fc 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -762,10 +762,8 @@ static ssize_t dev_nvram_read(struct file *file, char __user *buf,
count = min(count, PAGE_SIZE);
tmp = kmalloc(count, GFP_KERNEL);
- if (!tmp) {
- ret = -ENOMEM;
- goto out;
- }
+ if (!tmp)
+ return -ENOMEM;
ret = ppc_md.nvram_read(tmp, count, ppos);
if (ret <= 0)
--
2.11.0
Powered by blists - more mailing lists