Re: [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init()

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

 



On Mon, Nov 18, 2019 at 05:09:39PM +0800, Peter Chen wrote:
> BR,
> Peter Chen
> 
> On Wed, Oct 30, 2019 at 4:12 PM Peter Chen <peter.chen@xxxxxxx> wrote:
> >
> > On 19-10-30 03:40:46, Wei Yongjun wrote:
> > > The driver allocates the spinlock but not initialize it.
> > > Use spin_lock_init() on it to initialize it correctly.
> > >
> > > This is detected by Coccinelle semantic patch.
> > >
> > > Fixes: 1a1c851bbd70 ("usb: gadget: configfs: fix concurrent issue between composite APIs")
> > > Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> > > ---
> > >  drivers/usb/gadget/configfs.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
> > > index 33852c2b29d1..ab9ac48a751a 100644
> > > --- a/drivers/usb/gadget/configfs.c
> > > +++ b/drivers/usb/gadget/configfs.c
> > > @@ -1544,6 +1544,7 @@ static struct config_group *gadgets_make(
> > >       gi->composite.resume = NULL;
> > >       gi->composite.max_speed = USB_SPEED_SUPER;
> > >
> > > +     spin_lock_init(&gi->spinlock);
> > >       mutex_init(&gi->lock);
> > >       INIT_LIST_HEAD(&gi->string_list);
> > >       INIT_LIST_HEAD(&gi->available_func);
> > >
> >
> > Reviewed-by: Peter Chen <peter.chen@xxxxxxx>
> 
> Hi Felipe & Greg,
> 
> We may need this patch for usb/next and usb/linus tree, otherwise, there will
> be kernel dump if enable lockdep:

Ok, now queued up.

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux