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

Commit fafb38a1 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

xhci: hsic: Fix NULL pointer dereference in mxhci_hsic_hub_control



Primary HCD pointer is set when initializing SS HCD structure.
There is possibility of hub_port_staus getting called for HS
root hub when primary HCD pointer is not initialized. Hence
do not access primary HCD pointer in mxhci_hsic_hub_control.

Change-Id: Ie91a87b1a2d6757410f1f5c9c6010e2099c29420
CRs-Fixed: 674442
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 70d51296
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -984,12 +984,16 @@ void mxhci_hsic_shutdown(struct usb_hcd *hcd)
int mxhci_hsic_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
		u16 wIndex, char *buf, u16 wLength)
{
	struct mxhci_hsic_hcd *mxhci = hcd_to_hsic(hcd->primary_hcd);
	struct mxhci_hsic_hcd *mxhci;
	int ret = 0;
	u32 status;

	ret = xhci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);

	if (!hcd->primary_hcd)
		return ret;

	mxhci = hcd_to_hsic(hcd->primary_hcd);
	status = get_unaligned_le32(buf);

	if (typeReq == GetPortStatus) {