Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: serio_raw - fix uninitialized variable bug

Recent conversion of the driver to use guard notation for locks and
other resources introduced a bug: "written" variable that is supposed to
hold number of bytes successfully written was not initialized.

Fix it by initializing the variable with 0.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410201730.ItNhUTIv-lkp@intel.com/
Fixes: 5b53a9d40c4f ("Input: serio_raw - use guard notation for locks and other resources")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -1
+1 -1
drivers/input/serio/serio_raw.c
··· 185 185 { 186 186 struct serio_raw_client *client = file->private_data; 187 187 struct serio_raw *serio_raw = client->serio_raw; 188 - int written; 188 + int written = 0; 189 189 unsigned char c; 190 190 191 191 scoped_guard(mutex_intr, &serio_raw_mutex) {