usb: gadget: u_ether: Fix NULL pointer dereference in process_tx_w()
Current code checks if dev->port_usb is NULL, then reference to usb_ep
'in' is set to NULL and 'in' is passed as NULL in usb_ep_free_request()
If 'in' is passed as NULL in usb_ep_free_request() it would dereference
NULL pointer causing the crash.
Fix the issue by using port_usb_active flag which is set to false if
dev->port_usb is NULL. Instead of checking 'in' as NULL, check for
port_usb_active false condition before calling usb_ep_free_request().
Change-Id: I9b46c4f35dad5f80f71bcfd10ace0994817ea365
Signed-off-by:
Saket Saurabh <ssaurabh@codeaurora.org>
Loading
Please register or sign in to comment