[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2f7db46-1203-11b5-d749-4482ba697308@users.sourceforge.net>
Date: Thu, 19 Jan 2017 17:55:32 +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 2/8] powerpc/nvram: Return directly after a failed kmalloc()
in dev_nvram_write()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 19 Jan 2017 15:44:03 +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 | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 37d08b95c3f0..cf839adf3aa7 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -802,11 +802,9 @@ static ssize_t dev_nvram_write(struct file *file, const char __user *buf,
count = min_t(size_t, count, size - *ppos);
count = min(count, PAGE_SIZE);
-
- ret = -ENOMEM;
tmp = kmalloc(count, GFP_KERNEL);
if (!tmp)
- goto out;
+ return -ENOMEM;
ret = -EFAULT;
if (copy_from_user(tmp, buf, count))
--
2.11.0
Powered by blists - more mailing lists