Re: [PATCH] usb: cdnsp: Fixes error: uninitialized symbol 'len'

From: Greg KH
Date: Wed Apr 05 2023 - 13:55:31 EST


On Wed, Apr 05, 2023 at 07:41:53PM +0200, Oliver Neukum wrote:
> On 05.04.23 19:23, Greg KH wrote:
> > On Fri, Mar 31, 2023 at 05:06:00AM -0400, Pawel Laszczak wrote:
>
> > > {
> > > struct usb_ctrlrequest *ctrl = &pdev->setup;
> > > - int ret = 0;
> > > + int ret = -EINVAL;
> > > u16 len;
> > > trace_cdnsp_ctrl_req(ctrl);
> > > @@ -424,7 +424,6 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
> > > if (pdev->gadget.state == USB_STATE_NOTATTACHED) {
> > > dev_err(pdev->dev, "ERR: Setup detected in unattached state\n");
> > > - ret = -EINVAL;
> >
> > That's a nice change, but I don't see the original error here that you
> > are saying this change fixes.
> >
> > What am I missing?
>
> The function has this check at its beginning:
>
> if (!pdev->gadget_driver)
> goto out;

Argh, I missed this at the top of the function. I was looking further
down, sorry for the noise.

I'll go queue this up now, thanks.

greg k-h