mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-22 11:17:19 +00:00
Fix NULL-pointer dereference in usb_endpoint_foreach().
PR: usb/138389 Submitted by: Patroklos Argyroudis at census, inc
This commit is contained in:
parent
3bfbd845ff
commit
a9e267575b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=197558
@ -367,12 +367,14 @@ usb_init_endpoint(struct usb_device *udev, uint8_t iface_index,
|
||||
struct usb_endpoint *
|
||||
usb_endpoint_foreach(struct usb_device *udev, struct usb_endpoint *ep)
|
||||
{
|
||||
struct usb_endpoint *ep_end = udev->endpoints + udev->endpoints_max;
|
||||
struct usb_endpoint *ep_end;
|
||||
|
||||
/* be NULL safe */
|
||||
if (udev == NULL)
|
||||
return (NULL);
|
||||
|
||||
ep_end = udev->endpoints + udev->endpoints_max;
|
||||
|
||||
/* get next endpoint */
|
||||
if (ep == NULL)
|
||||
ep = udev->endpoints;
|
||||
|
Loading…
Reference in New Issue
Block a user