summaryrefslogtreecommitdiff
path: root/rust/kernel/num/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2026-01-19 16:13:26 +0100
committerUwe Kleine-König <ukleinek@kernel.org>2026-01-19 17:46:51 +0100
commitc198b7773ca5bc3bdfb15b85e414fb9a99a5e5ba (patch)
tree251de786783fe2c60ec18e6a9eb8088113146814 /rust/kernel/num/git@git.tavy.me:linux.git
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff)
pwm: Ensure ioctl() returns a negative errno on error
copy_to_user() returns the number of bytes not copied, thus if there is a problem a positive number. However the ioctl callback is supposed to return a negative error code on error. This error is a unfortunate as strictly speaking it became ABI with the introduction of pwm character devices. However I never saw the issue in real life -- I found this by code inspection -- and it only affects an error case where readonly memory is passed to the ioctls or the address mapping changes while the ioctl is active. Also there are already error cases returning negative values, so the calling code must be prepared to see such values already. Fixes: 9c06f26ba5f5 ("pwm: Add support for pwmchip devices for faster and easier userspace access") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20260119151325.571857-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'rust/kernel/num/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions