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

Commit 6625ceed authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dwc3: gadget: Add NULL check against endpoint desc"

parents 566660b1 d223be4a
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -815,7 +815,13 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc,
		dwc->delayed_status = true;

out:
	if (ret < 0) {
	/*
	 * Don't try to halt ep0 if ret is -ESHUTDOWN.
	 * ret as -ESHUTDOWN suggests that setup packet related response
	 * is available but queueing of ep0 is failed. Possibly ep0 is
	 * already disabled.
	 */
	if (ret < 0 && ret != -ESHUTDOWN) {
		dbg_event(0x0, "ERRSTAL", ret);
		dwc3_ep0_stall_and_restart(dwc);
	}
+5 −0
Original line number Diff line number Diff line
@@ -1443,6 +1443,11 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol)
	struct dwc3				*dwc = dep->dwc;
	int					ret;

	if (!dep->endpoint.desc) {
		dev_dbg(dwc->dev, "(%s)'s desc is NULL.\n", dep->name);
		return -EINVAL;
	}

	if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
		dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name);
		return -EINVAL;