[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220506071023.GB4031@kadam>
Date: Fri, 6 May 2022 10:10:23 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Wang Cheng <wanngchenng@...il.com>
Cc: paskripkin@...il.com, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8()
and friends
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.
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
Powered by blists - more mailing lists