]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:18:51 +0000 (08:18 +0200)
commit3655034daad1a4d5b684f3cea6efe0f7eb676d20
tree09894002854e8605a61ce171eef3e62fad6d39bf
parentd08742fefe87032910e341b9218b504a7032e14c
usb: gadget: legacy: fix error return code in cdc_bind()

commit e8f7f9e3499a6d96f7f63a4818dc7d0f45a7783b upstream.

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

Fixes: ab6796ae9833 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/cdc2.c