Unverified Commit 5ea90b2b authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 691cdd68 34d17c88
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -99,12 +99,10 @@ int usb_ep_enable(struct usb_ep *ep)
		goto out;

	/* UDC drivers can't handle endpoints with maxpacket size 0 */
	if (usb_endpoint_maxp(ep->desc) == 0) {
		/*
		 * We should log an error message here, but we can't call
		 * dev_err() because there's no way to find the gadget
		 * given only ep.
		 */
	if (!ep->desc || usb_endpoint_maxp(ep->desc) == 0) {
		WARN_ONCE(1, "%s: ep%d (%s) has %s\n", __func__, ep->address, ep->name,
			  (!ep->desc) ? "NULL descriptor" : "maxpacket 0");

		ret = -EINVAL;
		goto out;
	}