diff options
| author | Adrian Ambrozewicz <aambrozewicz@nvidia.com> | 2026-10-22 11:33:44 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-10-23 09:48:36 +0200 |
| commit | dae739137441667d67fbfcc4d303a0ecc6618662 (patch) | |
| tree | 9146df5f4646e593e92a19b84c64f267b59df436 /tools/perf/scripts/python/bin | |
| parent | 15665047024e30f9c2227563d03034061c99ac2c (diff) | |
| download | lwn-dae739137441667d67fbfcc4d303a0ecc6618662.tar.gz lwn-dae739137441667d67fbfcc4d303a0ecc6618662.zip | |
gpiolib: don't report -ENOMEM for a requested line without a label
gpiod_request_commit() sets GPIOD_FLAG_REQUESTED, calls ->request() and
only then sets the label. A line in between has no label, so
gpiochip_dup_line_label() passes NULL to kstrdup() and returns
ERR_PTR(-ENOMEM), which for_each_hwgpio() then passes to kfree():
BUG: unable to handle page fault for address: ffcc73074355ffc8
Call Trace:
gpio_sim_dbg_show
gpiolib_seq_show
seq_read_iter
Return NULL for such a line, as for an unrequested one.
Reproduced with gpio-sim: reading /sys/kernel/debug/gpio in a loop while
lines are requested and released oopses within seconds; with this
change, 100000 cycles pass.
Fixes: 35b545332b80 ("gpio: remove gpio_lock")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20261020-gpiolib-chip-removal-v3-0-aambrozewicz@nvidia.com?part=2
Assisted-by: LLM
Signed-off-by: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
Link: https://patch.msgid.link/20261022083343.3905973-3-aambrozewicz@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
