Commit 2f6115a
Bartosz Golaszewski
gpiolib: fix invalid pointer access in debugfs
If the memory allocation in gpiolib_seq_start() fails, the s->private
field remains uninitialized and is later dereferenced without checking
in gpiolib_seq_stop(). Initialize s->private to NULL before calling
kzalloc() and check it before dereferencing it.
Fixes: e348544 ("gpio: protect the list of GPIO devices with SRCU")
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>1 parent e5d527b commit 2f6115a
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5296 | 5296 | | |
5297 | 5297 | | |
5298 | 5298 | | |
| 5299 | + | |
| 5300 | + | |
5299 | 5301 | | |
5300 | 5302 | | |
5301 | 5303 | | |
| |||
5329 | 5331 | | |
5330 | 5332 | | |
5331 | 5333 | | |
5332 | | - | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
5333 | 5339 | | |
5334 | 5340 | | |
5335 | 5341 | | |
| |||
0 commit comments