Re: [PATCH] char: mwave: fix return type in ioctl

From: Arnd Bergmann
Date: Thu Aug 04 2022 - 04:20:57 EST


On Thu, Aug 4, 2022 at 9:06 AM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> This function is supposed to return zero for success or negative error
> code on failure. Unfortunately the "retval" is declared as unsigned int
> and the function returns type long. That means that on 64 bit systems
> it will return positive values on error.
>
> Fixes: 909d145f0dec ("mwave: ioctl BKL pushdown")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> The Fixes tag is sort of debatable. "retval" should have always been
> declared as an int. But the BKL change is when the return type for
> the ioctl changed from int to long, so it's when the bug started to
> affect user space.

Nice catch, I wonder how many other drivers I broke in that series.
Have you gone through my BKL commits from that time period
to see if any others are affected?

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>