Thread (118 messages) 118 messages, 10 authors, 2021-08-30

Re: [PATCH RFC 0/3] staging: r8188eu: avoid uninit value bugs

From: Fabio M. De Francesco <hidden>
Date: 2021-08-22 13:21:43
Also in: lkml

On Sunday, August 22, 2021 2:39:34 PM CEST Greg KH wrote:
On Sun, Aug 22, 2021 at 03:10:56PM +0300, Pavel Skripkin wrote:
quoted
On 8/22/21 1:59 PM, Fabio M. De Francesco wrote:
quoted
On Sunday, August 22, 2021 12:09:29 PM CEST Pavel Skripkin wrote:
[...]
quoted
quoted
So, it's up to the callers to test if (!_rtw_read*()) and then act
accordingly. If they get 0 they should know how to handle the errors.
Yes, but _rtw_read*() == 0 indicates 2 states:
	1. Error on transfer side
	2. Actual register value is 0
That's not a good design, it should be fixed.  Note there is the new
usb_control_msg_recv() function which should probably be used instead
here, to prevent this problem from happening.
I think that no functions should return 0 for signaling FAILURE. If I'm not 
wrong, the kernel quite always prefers to return 0 on SUCCESS and <0 on 
FAILURE. Why don't you just fix this?
quoted
quoted
In summation. if anything should be changed, it is the code of the 
callers of
quoted
quoted
_rtw_read*() if you find out they they don't properly handle the 
returning
quoted
quoted
values of this function. You should find every place where _rtw_read*() 
are
quoted
quoted
called and figure out if the returns are properly checked and handled; 
if not,
quoted
quoted
make some change only there.

Larry, Philip, where are you? Am I missing something?
Relax, there is no need to get jumpy, people do not have to respond
instantly to emails here.  Especially when it is not their job to do so.
I should have placed a big smile at the end of the phrase. I was just kidding 
while trying to get their attention. I know there is no hurry and that no one 
has any obligation of this kind. Again, just kidding :)

Thanks,

Fabio
greg k-h


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help