mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Bartosz Golaszewski" <brgl@bgdev.pl>, "Arnd Bergmann" <arnd@kernel.org>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Kent Gibson" <warthog618@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpio: cdev: avoid uninitialized variable dereference
Date: Fri, 16 Feb 2024 15:04:14 +0100	[thread overview]
Message-ID: <14ab7b63-b2c0-41e3-8104-da5515b379be@app.fastmail.com> (raw)
In-Reply-To: <CAMRc=MdBbzff5BppY4Hjwfi=SnmYopnFxg1AX4QsGt3Y+-g60Q@mail.gmail.com>

On Fri, Feb 16, 2024, at 14:19, Bartosz Golaszewski wrote:
> On Fri, Feb 16, 2024 at 2:00 PM Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The 'gc' variable is never set before it gets printed:
>>
>> drivers/gpio/gpiolib-cdev.c:2802:11: error: variable 'gc' is uninitialized when used here [-Werror,-Wuninitialized]
>>  2802 |         chip_dbg(gc, "added GPIO chardev (%d:%d)\n", MAJOR(devt), gdev->id);
>>       |                  ^~
>> drivers/gpio/gpiolib.h:277:11: note: expanded from macro 'chip_dbg'
>>   277 |         dev_dbg(&gc->gpiodev->dev, "(%s): " fmt, gc->label, ##__VA_ARGS__)
>>       |                  ^~
>>
>> Use dev_dbg() directly.
>>
>> Fixes: 8574b5b47610 ("gpio: cdev: use correct pointer accessors with SRCU")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>
> I seem to have beat you to it[1] and my patch doesn't change the log
> message so I'll apply it instead of this one.

Ok, thanks. I thought about doing this, but could not
figure out which of the RCU primitives to use.

     Arnd

  reply	other threads:[~2024-02-16 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 12:59 Arnd Bergmann
2024-02-16 13:19 ` Bartosz Golaszewski
2024-02-16 14:04   ` Arnd Bergmann [this message]
2024-02-16 15:51     ` Paul E. McKenney
2024-02-16 16:17       ` Arnd Bergmann
2024-02-16 16:50         ` Paul E. McKenney

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=14ab7b63-b2c0-41e3-8104-da5515b379be@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=warthog618@gmail.com \
    /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

all inboxes | Powered by JetHome®