Re: [PATCH] iio: buffer: return 0 for buffer getfd ioctl handler

2021-03-29 Thread Jonathan Cameron
On Mon, 22 Mar 2021 10:41:35 +0200 Alexandru Ardelean wrote: > As Lars pointed out, we could either return the FD vs memcpy-ing it to the > userspace data object. > > However, this comment exposed a bug. We should return 0 or negative from > these ioctl() handlers. Because an ioctl() handler

[PATCH] iio: buffer: return 0 for buffer getfd ioctl handler

2021-03-22 Thread Alexandru Ardelean
As Lars pointed out, we could either return the FD vs memcpy-ing it to the userspace data object. However, this comment exposed a bug. We should return 0 or negative from these ioctl() handlers. Because an ioctl() handler can also return IIO_IOCTL_UNHANDLED (which is positive 1), which means that