Skip to content

Commit d236dc1

Browse files
Rupesh Gujaregregkh
authored andcommitted
staging: ozwpan: Check error condition before creating endpoint.
Check if interface number is correct before creating an end point. Signed-off-by: Rupesh Gujare <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0a7bfbf commit d236dc1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/staging/ozwpan/ozhcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,8 @@ static int oz_build_endpoints_for_interface(struct usb_hcd *hcd,
12471247
int request_heartbeat = 0;
12481248

12491249
oz_dbg(ON, "interface[%d] = %p\n", if_ix, intf);
1250+
if (if_ix >= port->num_iface || port->iface == NULL)
1251+
return -ENOMEM;
12501252
for (i = 0; i < intf->desc.bNumEndpoints; i++) {
12511253
struct usb_host_endpoint *hep = &intf->endpoint[i];
12521254
u8 ep_addr = hep->desc.bEndpointAddress;

0 commit comments

Comments
 (0)