USB: gadget: qdss: Return Error when set_alt failed

QDSS functionality is not supported with Full Speed mode. If it is enabled,
it returns success when its set_alt fails after checking USB speed. With
this usb enumeration happens and on USB cable disconnect, qdss_disable() is
called which is crashing the system due to NULL pointer dereference in
uninit_data().

qdss_disable() is also called as part of reset_config() on returning above
error code as part of set_config(). This would again lead to crash as
uninit_data() is being called as part of qdss_disable().

Fix this issue by returning correct error code when QDSS is being used
with Full Speed mode which would failed USB enumeration. And add check in
qdss_disable() to resolve cable disconnect issue.

CRs-Fixed: 529148
Change-Id: Id27a857b0614ce0536ed96f7afe8e4dbf57a268c
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
1 file changed