lkml.org 
[lkml]   [2024]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpio: cdev: avoid uninitialized variable dereference
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

\
 
 \ /
  Last update: 2024-05-27 15:06    [W:0.239 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site