usb: udc: core: Use lock when write to soft_connect
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 14 Jan 2021 08:09:51 +0000 (00:09 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 10:47:51 +0000 (11:47 +0100)
commitf764f90b0c77aa1d63c061f16b95a18842a45f29
tree9a6ddd19948434a146d31c7007ce0d229cfab79e
parent564f3c53264241424feace9ffc0df5538402fc98
usb: udc: core: Use lock when write to soft_connect

commit c28095bc99073ddda65e4f31f6ae0d908d4d5cd8 upstream.

Use lock to guard against concurrent access for soft-connect/disconnect
operations when writing to soft_connect sysfs.

Fixes: 2ccea03a8f7e ("usb: gadget: introduce UDC Class")
Cc: stable@vger.kernel.org
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/338ea01fbd69b1985ef58f0f59af02c805ddf189.1610611437.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/core.c