提交 b6d80852 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

greybus: es2: fix endpoint requirement check

The current es2 implementation only checks for no IN or OUT bulk
endpoints, but still assumes there are precisely NUM_BULKS of each.

Specifically, urbs could be allocated and initialised to default values,
which amounts to bulk urbs being submitted to the control endpoint.

We should be able to handle any number of endpoints, but for now let's
just require NUM_BULKS of each.
Signed-off-by: NJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@google.com>
上级 a51e8551
......@@ -848,8 +848,7 @@ static int ap_probe(struct usb_interface *interface,
endpoint->bEndpointAddress);
}
}
if ((bulk_in == 0) ||
(bulk_out == 0)) {
if (bulk_in != NUM_BULKS || bulk_out != NUM_BULKS) {
dev_err(&udev->dev, "Not enough endpoints found in device, aborting!\n");
goto error;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册