Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562924 > unrolled thread

[PATCH 1/8] powerpc/nvram: Return directly after a failed parameter validation in dev_nvram_write()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-01-19 18:00 +0100
Last post2017-01-19 18:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/8] powerpc/nvram: Return directly after a failed parameter  validation in dev_nvram_write() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-19 18:00 +0100

#1562924 — [PATCH 1/8] powerpc/nvram: Return directly after a failed parameter validation in dev_nvram_write()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-01-19 18:00 +0100
Subject[PATCH 1/8] powerpc/nvram: Return directly after a failed parameter validation in dev_nvram_write()
Message-ID<t1oe6-40V-27@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 19 Jan 2017 15:22:56 +0100

* Return directly after an inappropriate input parameter was detected.

* Delete an initialisation for the variable "tmp" at the beginning
  and an assignment for the variable "ret" which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 arch/powerpc/kernel/nvram_64.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 34d2c595de23..37d08b95c3f0 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -790,17 +790,15 @@ static ssize_t dev_nvram_write(struct file *file, const char __user *buf,
 			  size_t count, loff_t *ppos)
 {
 	ssize_t ret;
-	char *tmp = NULL;
+	char *tmp;
 	ssize_t size;
 
-	ret = -ENODEV;
 	if (!ppc_md.nvram_size)
-		goto out;
+		return -ENODEV;
 
-	ret = 0;
 	size = ppc_md.nvram_size();
 	if (*ppos >= size || size < 0)
-		goto out;
+		return 0;
 
 	count = min_t(size_t, count, size - *ppos);
 	count = min(count, PAGE_SIZE);
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web