From: Wei Yongjun <weiyongjun1@huawei.com> To: Felipe Balbi <balbi@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Peter Chen <peter.chen@nxp.com> Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init() Date: Wed, 30 Oct 2019 03:40:46 +0000 [thread overview] Message-ID: <20191030034046.188808-1-weiyongjun1@huawei.com> (raw) 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);
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com> To: Felipe Balbi <balbi@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Peter Chen <peter.chen@nxp.com> Cc: Wei Yongjun <weiyongjun1@huawei.com>, <linux-usb@vger.kernel.org>, <kernel-janitors@vger.kernel.org> Subject: [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init() Date: Wed, 30 Oct 2019 03:40:46 +0000 [thread overview] Message-ID: <20191030034046.188808-1-weiyongjun1@huawei.com> (raw) 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);
next reply other threads:[~2019-10-30 3:40 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-30 3:40 Wei Yongjun [this message] 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-18 9:09 ` Peter Chen 2019-11-20 19:47 ` Greg Kroah-Hartman 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=20191030034046.188808-1-weiyongjun1@huawei.com \ --to=weiyongjun1@huawei.com \ --cc=balbi@kernel.org \ --cc=gregkh@linuxfoundation.org \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-usb@vger.kernel.org \ --cc=peter.chen@nxp.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.