usb: gadget: configfs: Fix missing spin_lock_init()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 30 Oct 2019 03:40:46 +0000 (03:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 18:55:23 +0000 (19:55 +0100)
commit58849169408e422bcd254234bb576dd280a0fc7f
tree7d859860dca2bf20e243362601f9f73aa391749d
parentf7688b48ac46e9a669e279f1bc167722d5141eda
usb: gadget: configfs: Fix missing spin_lock_init()

commit 093edc2baad2c258b1f55d1ab9c63c2b5ae67e42 upstream.

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>
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/20191030034046.188808-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/configfs.c