From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Naresh Kamboju <naresh.kamboju@linaro.org>
Subject: Re: [PATCH v1 1/1] gpio: sim: Initialize attribute allocated on the heap
Date: Fri, 9 Apr 2021 10:10:29 +0200 [thread overview]
Message-ID: <CAMRc=MdPYxvwUtG2LhOkqGMj1fttnJ8jv+15GeoSqqkLKdmM8Q@mail.gmail.com> (raw)
In-Reply-To: <20210408155506.12636-1-andriy.shevchenko@linux.intel.com>
On Thu, Apr 8, 2021 at 6:24 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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@linaro.org>
> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.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
>
So writing tests really serves a purpose, heh? :)
Thanks for the patch and QA Andy and Naresh, patch applied.
Bartosz
prev parent reply other threads:[~2021-04-09 8:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 15:55 [PATCH v1 1/1] gpio: sim: Initialize attribute allocated on the heap Andy Shevchenko
2021-04-09 8:10 ` Bartosz Golaszewski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMRc=MdPYxvwUtG2LhOkqGMj1fttnJ8jv+15GeoSqqkLKdmM8Q@mail.gmail.com' \
--to=brgl@bgdev.pl \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naresh.kamboju@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).