lkml.org 
[lkml]   [2022]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8() and friends
On 22/05/06 10:10AM, Dan Carpenter wrote:
> Setting "data = 0" will silence the KMSAN warnings but it doesn't fix
> the bug which is that r8712_usbctrl_vendorreq() treats partial reads
> as success.
>
> The usb_control_msg() returns negatives on total failure and it returns
> small positives on partial failure. So take the code that I gave you
> before and put that into r8712_usbctrl_vendorreq(). That's patch 1.
> These patches become 2 and 3.

Ah, you mentioned in previous review "But then another problem is that
"status" can be less than "len"." I missed it then.

- w

>
> status = usb_control_msg();
> if (status < 0)
> goto free;
> if (status != len) {
> status = -EREMOTEIO;
> goto free;
> }
> if (requesttype == 0x01)
> memcpy(pdata, pIo_buf, status);
>
> regards,
> dan carpenter
>

\
 
 \ /
  Last update: 2022-05-06 13:23    [W:0.050 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site