[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <KL1PR01MB54489B7A3D9D02D242B4BDA1E6669@KL1PR01MB5448.apcprd01.prod.exchangelabs.com>
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