Linux USB
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"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, 30 Oct 2019 08:11:12 +0000	[thread overview]
Message-ID: <20191030081101.GF26815@b29397-desktop> (raw)
In-Reply-To: <20191030034046.188808-1-weiyongjun1@huawei.com>

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>

-- 

Thanks,
Peter Chen

  reply	other threads:[~2019-10-30  8:11 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 [this message]
2019-11-18  9:09   ` Peter Chen
2019-11-20 19:47     ` Greg Kroah-Hartman

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=20191030081101.GF26815@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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