[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210408155506.12636-1-andriy.shevchenko@linux.intel.com>
Date: Thu, 8 Apr 2021 18:55:06 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Linus Walleij <linus.walleij@...aro.org>,
Naresh Kamboju <naresh.kamboju@...aro.org>
Subject: [PATCH v1 1/1] gpio: sim: Initialize attribute allocated on the heap
The attributes on the heap must be initialized before use.
Neglecting that will produce an Oops in some configurations:
BUG: key ffff000800eba398 has not been registered!
Initialize attribute allocated on the heap.
Fixes: 3f0279eb9e37 ("gpio: sim: new testing module")
Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@...aro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/gpio/gpio-sim.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index ea17289a869c..92493b98c51b 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -284,6 +284,7 @@ static int gpio_sim_setup_sysfs(struct gpio_sim_chip *chip)
line_attr->offset = i;
dev_attr = &line_attr->dev_attr;
+ sysfs_attr_init(&dev_attr->attr);
dev_attr->attr.name = devm_kasprintf(dev, GFP_KERNEL,
"gpio%u", i);
--
2.30.2
Powered by blists - more mailing lists