USB: gadget: legacy: fix return error code in acm_ms_bind()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 17 Nov 2020 09:29:55 +0000 (17:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 18:49:04 +0000 (19:49 +0100)
commite80db09b76fb382d841ef4e0e4d46b7aa581c17f
treeab90b4f911555446d5f0e682d0e610ea25011322
parent97d36b7be15c4368334afe93a6766b06ad53d3e6
USB: gadget: legacy: fix return error code in acm_ms_bind()

commit c91d3a6bcaa031f551ba29a496a8027b31289464 upstream.

If usb_otg_descriptor_alloc() failed, it need return ENOMEM.

Fixes: 578aa8a2b12c ("usb: gadget: acm_ms: allocate and init otg descriptor by otg capabilities")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201117092955.4102785-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/acm_ms.c