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

Commit b3ccc7e4 authored by Hemant Kumar's avatar Hemant Kumar Committed by Pratham Pratap
Browse files

usb: f_gsi: Fix error handling path in ipa_connect_channels



Commit 7674e8f6a77e ("usb: f_gsi: Don't enable IPA data path
if connect channel fails") added error handling path and IN and
out endpoints. For DPL out ep and out request are NULL. In case
ipa_connect_channels returns error for DPL usb_gsi_ep_op() is
de-referencing NULL pointer. Add NULL check for out ep in error
handling path.

Change-Id: Ia2db2ed840a4ab9032366042f00a1a9ac086d91f
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 1520ba63
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -668,9 +668,11 @@ static int ipa_connect_channels(struct gsi_data_port *d_port)
	return ret;

end_xfer_ep_out:
	if (d_port->out_ep)
		usb_gsi_ep_op(d_port->out_ep, NULL,
			GSI_EP_OP_ENDXFER);
free_trb_ep_out:
	if (d_port->out_ep)
		usb_gsi_ep_op(d_port->out_ep, &d_port->out_request,
			GSI_EP_OP_FREE_TRBS);
end_xfer_ep_in: