Re: [PATCH v2] media: smsusb: better handle optional alignment

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

 



Em Fri, 24 May 2019 21:09:41 +0200
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> escreveu:

> On Fri, May 24, 2019 at 10:59:43AM -0400, Mauro Carvalho Chehab wrote:
> > Most Siano devices require an alignment for the response.
> > 
> > Changeset f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb")
> > changed the logic with gets such aligment, but it now produces a
> > sparce warning:
> > 
> > drivers/media/usb/siano/smsusb.c: In function 'smsusb_init_device':
> > drivers/media/usb/siano/smsusb.c:447:37: warning: 'in_maxp' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >   447 |   dev->response_alignment = in_maxp - sizeof(struct sms_msg_hdr);
> >       |                             ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > The sparse message itself is bogus, but a broken (or fake) USB
> > eeprom could produce a negative value for response_alignment.
> > 
> > So, change the code in order to check if the result is not
> > negative.
> > 
> > Fixes: f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb")
> > CC: <stable@xxxxxxxxxxxxxxx>
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@xxxxxxxxxx>
> > ---
> > 
> > Greg,
> > 
> > As the Alan patches went via your tree, please apply this one too.  
> 
> Thanks, now done, and I fixed up the Fixes: sha1 tag to match my tree.

Ah, thanks! I forgot about that :-)

> 
> greg k-h



Thanks,
Mauro



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux