]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpiolib: cdev: Cleanup kfifo_out() error handling
authorKent Gibson <warthog618@gmail.com>
Wed, 29 May 2024 13:19:53 +0000 (21:19 +0800)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 30 May 2024 09:29:10 +0000 (11:29 +0200)
commit2ba4746b418dcffadb3b135657fea8d3e62b4c30
treee919947b90d2b82a0c0efc2d9e76dd6008fd7031
parent4ce5ca654a761462a222164e96b8ab953b8cacab
gpiolib: cdev: Cleanup kfifo_out() error handling

The handling of kfifo_out() errors in read functions obscures any error.
The error condition should never occur but, while a ret is set to -EIO, it
is subsequently ignored and the read functions instead return the number
of bytes copied to that point, potentially masking the fact that any error
occurred.

Log a warning and return -EIO in the case of a kfifo_out() error to make
it clear something very odd is going on here.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Link: https://lore.kernel.org/r/20240529131953.195777-4-warthog618@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-cdev.c