Skip to content

Commit bf1d50f

Browse files
g0hl1ndtor
authored andcommitted
Input: avoid negative input device numbers
Fix the format string for input device name generation to avoid negative device numbers when the id exceeds the maximum signed integer value. Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 2c9a9cf commit bf1d50f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1789,7 +1789,7 @@ struct input_dev *input_allocate_device(void)
17891789
INIT_LIST_HEAD(&dev->h_list);
17901790
INIT_LIST_HEAD(&dev->node);
17911791

1792-
dev_set_name(&dev->dev, "input%ld",
1792+
dev_set_name(&dev->dev, "input%lu",
17931793
(unsigned long) atomic_inc_return(&input_no) - 1);
17941794

17951795
__module_get(THIS_MODULE);

0 commit comments

Comments
 (0)