[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MdBbzff5BppY4Hjwfi=SnmYopnFxg1AX4QsGt3Y+-g60Q@mail.gmail.com>
Date: Fri, 16 Feb 2024 14:19:51 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Linus Walleij <linus.walleij@...aro.org>, "Paul E. McKenney" <paulmck@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Kent Gibson <warthog618@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio: cdev: avoid uninitialized variable dereference
On Fri, Feb 16, 2024 at 2:00 PM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.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@...db.de>
> ---
Hi Arnd,
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.
Thanks,
Bartosz
[1] https://lore.kernel.org/linux-gpio/1542ef65-508b-45be-ad5c-63ad124cb1a2@samsung.com/T/#t
Powered by blists - more mailing lists