lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1803300829580.2870@hadrien>
Date:   Fri, 30 Mar 2018 08:32:56 +0200 (CEST)
From:   Julia Lawall <julia.lawall@...6.fr>
To:     Laura Abbott <labbott@...hat.com>
cc:     Linus Walleij <linus.walleij@...aro.org>, kbuild-all@...org,
        Kees Cook <keescook@...omium.org>,
        Lukas Wunner <lukas@...ner.de>,
        Laura Abbott <labbott@...hat.com>, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-hardening@...ts.openwall.com,
        Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: [PATCH] gpio: fix ifnullfree.cocci warnings (fwd)

From: Fengguang Wu <fengguang.wu@...el.com>

NULL check before kfree is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: ad85ae608fe0 ("gpio: Remove VLA from gpiolib")
CC: Laura Abbott <labbott@...hat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
Signed-off-by: Julia Lawall <julia.lawall@...6.fr>

---

url:
https://github.com/0day-ci/linux/commits/Laura-Abbott/gpio-Remove-VLA-from-gpiolib/20180330-065639
base:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
for-next

 gpiolib.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2758,8 +2758,7 @@ int gpiod_get_array_value_complex(bool r

 		ret = gpio_chip_get_multiple(chip, mask, bits);
 		if (ret) {
-			if (slowpath)
-				kfree(slowpath);
+			kfree(slowpath);
 			return ret;
 		}

@@ -2774,8 +2773,7 @@ int gpiod_get_array_value_complex(bool r
 			trace_gpio_value(desc_to_gpio(desc), 1, value);
 		}

-		if (slowpath)
-			kfree(slowpath);
+		kfree(slowpath);
 	}
 	return 0;
 }
@@ -3020,8 +3018,7 @@ int gpiod_set_array_value_complex(bool r
 		if (count != 0)
 			gpio_chip_set_multiple(chip, mask, bits);

-		if (slowpath)
-			kfree(slowpath);
+		kfree(slowpath);
 	}
 	return 0;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ