On Tuesday, August 24, 2021 9:27:27 AM CEST Pavel Skripkin wrote:
_rtw_read8 function can fail in case of usb transfer failure. But
previous function prototype wasn't designed to return an error to
caller. It can cause a lot uninit value bugs all across the driver code,
since rtw_read8() returns local stack variable to caller.
Fix it by changing the prototype of this function. Now it returns an
int: 0 on success, negative error value on failure and callers should pass
the pointer to storage location for register value.
Signed-off-by: Pavel Skripkin <paskripkin@xxxxxxxxx>
Dear Pavel,
I have to inform you that building patch v3 3/6 with gcc (version 11.1.1 20210721
[revision 076930b9690ac3564638636f6b13bbb6bc608aea] (SUSE Linux)), gives
the following warning:
drivers/staging/r8188eu/os_dep/ioctl_linux.c:2258:13: warning: variable ‘error’ set but not used [-Wunused-but-set-variable]
2258 | int error;
| ^~~~~
I'm sorry, but I guess that for some reason previously I had only built v2 of your patch
which had no warnings at all.
Unfortunately, introducing warnings is not allowed.
While we are at this, I can also confirm that GCC 11.1.1 _does_ _not_ emit the warning
that has been reported by the kernel test robot.