]> git.baikalelectronics.ru Git - kernel.git/commit
usb: gadget: legacy: fix error return code in cdc_bind()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 7 May 2020 05:13:32 +0000 (05:13 +0000)
committerFelipe Balbi <balbi@kernel.org>
Sat, 9 May 2020 08:05:08 +0000 (11:05 +0300)
commitd8fe28e74e9144663c514add95724de554d57894
tree63dc04d8dce549ac63fe49102013173413c3c862
parentf5db605ffd646740a0448e0a02ad81c3d0b86863
usb: gadget: legacy: fix error return code in cdc_bind()

If 'usb_otg_descriptor_alloc()' fails, we must return a
negative error code -ENOMEM, not 0.

Fixes: da1aed1a46e6 ("usb: gadget: cdc2: allocate and init otg descriptor by otg capabilities")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/gadget/legacy/cdc2.c