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]
Date:   Sun, 23 Apr 2023 19:03:12 +0800
From:   Yan Wang <rk.code@...look.com>
To:     linus.walleij@...aro.org, brgl@...ev.pl
Cc:     Yan Wang <rk.code@...look.com>,
        linux-gpio@...r.kernel.org (open list:GPIO SUBSYSTEM),
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v1] gpio: gpiolib: clear the array_info's memory space

if hardware number different to array index,it needs to clear to points
memory space if the array_info have been assigned a value.

Signed-off-by: Yan Wang <rk.code@...look.com>
---
 drivers/gpio/gpiolib.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 04fb05df805b..cdaffcdd45b2 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4340,8 +4340,11 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
 		}
 
 		/* If there is no cache for fast bitmap processing path, continue */
-		if (!array_info)
+		if (!array_info) {
+			/*clear descs->info*/
+			memset(array_info, 0, sizeof(struct gpio_array));
 			continue;
+		}
 
 		/* Unmark array members which don't belong to the 'fast' chip */
 		if (array_info->chip != gc) {
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ