Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10205374 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: qti: Avoid passing NULL to disconnect()



When QTI control gets disconnected from an RmNet function,
it calls frmnet_disconnect() via the grmnet->disconnect
callback using port->port_usb, which gets set to NULL later
in the same context. However, if for some reason this
gqti_ctrl_disconnect() function is called again (such as
for spurious suspend events when remote wakeup is disabled),
this NULL pointer would be psased to frmnet_disconnect() which
then spits out an error message.

While the cause of spurious suspends also needs to be solved,
we can at least avoid excessive log spam by instead passing
the grmnet pointer directly which should be a valid pointer--
frmnet_disconnect() will correctly and silently bail out if it
is already disconnected.

Change-Id: I517a7a9cb9341cda16db7d369006510529ce193b
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent bbbf11a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment