Re: [PATCH] media: sq905.c: fix uninitialized variable
From: Pavel Skripkin
Date: Fri Mar 26 2021 - 03:25:37 EST
Hi!
On Fri, 2021-03-26 at 08:14 +0100, 'Dmitry Vyukov' via syzkaller wrote:
> On Fri, Mar 26, 2021 at 8:11 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
> wrote:
> >
> > On Thu, Mar 25, 2021 at 11:22:02PM +0200, Alaa Emad wrote:
> > > Reported-by: syzbot+a4e309017a5f3a24c7b3@xxxxxxxxxxxxxxxxxxxxxxxxx
> > > Signed-off-by: Alaa Emad <alaaemadhossney.ae@xxxxxxxxx>
> > > ---
> >
> > I know I do not take patches with no changelog text, but other
> > maintainers might be more leniant :(
>
> I wonder if it's the right fix or not.
> Initializing variables will, of course, silence the warning, but it's
> not necessarily the right fix. I suspect there is something wrong in
> how ret/act_len are user/checked.
>
There is a problem in usb_bulk_msg() call. It could return before
act_len initialization, so i think, act_len should be intialized with
smth wrong like 0 or -1. BTW, I already send patch for that, but it was
marked as obsoleted.
--
With regards,
Pavel Skripkin