linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peter Chen <hzpeterchen@gmail.com>
Cc: Peter Chen <peter.chen@nxp.com>, Felipe Balbi <balbi@kernel.org>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init()
Date: Wed, 20 Nov 2019 20:47:09 +0100	[thread overview]
Message-ID: <20191120194709.GA3092233@kroah.com> (raw)
In-Reply-To: <CAL411-pVmtTr58YFmsotcY+w2KR3kR1hQ1bJOG9CNA-fmPQYGg@mail.gmail.com>

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@nxp.com> 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@huawei.com>
> > > ---
> > >  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@nxp.com>
> 
> 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

      reply	other threads:[~2019-11-20 19:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30  3:40 [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init() Wei Yongjun
2019-10-30  8:11 ` Peter Chen
2019-11-18  9:09   ` Peter Chen
2019-11-20 19:47     ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191120194709.GA3092233@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=balbi@kernel.org \
    --cc=hzpeterchen@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@nxp.com \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).