Re: [PATCH v2 1/2] staging: rtl8712: fix uninit-value in usb_read8() and friends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 06, 2022 at 10:23:39AM +0300, Pavel Skripkin wrote:
> Hi Wang,
> 
> On 5/6/22 06:15, Wang Cheng wrote:
> > When r8712_usbctrl_vendorreq() returns negative, 'data' in
> > usb_read{8,16,32} will not be initialized.
> 
> [code snip]
> 
> > +	status = r8712_usbctrl_vendorreq(intfpriv, request, wvalue, index,
> > +					 &data, len, requesttype);
> > +	if (status < 0)
> > +		return 0;
> >   	return le32_to_cpu(data);
> >   }
> 
> Why do you believe that 0 is not valid register value? And if it's possible
> then how you can identify an error?

I think you are getting data and status mixed up?

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux