usb: gadget: legacy: fix error return code of msg_bind()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Tue, 23 Mar 2021 12:36:48 +0000 (05:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 13:13:29 +0000 (14:13 +0100)
commitf2b6ebf61e8fcd0b1f03a084d39742b1f6113ac4
tree4c19562057454ba009c98e2559bb5526d1a83caf
parentd07247ff2515d7d2db60e6492cd4662d87bf7bf2
usb: gadget: legacy: fix error return code of msg_bind()

When usb_otg_descriptor_alloc() returns NULL to usb_desc, no error
return code of msg_bind() is assigned.
To fix this bug, status is assigned with -ENOMEM in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210323123648.3997-1-baijiaju1990@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/mass_storage.c