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

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

Fixes: 8afa873d3c78 ("usb: gadget: ncm: 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/ncm.c