git: 9e7356944da4 - stable/13 - usb: fix loop in usb_config_parse

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Wed, 13 Nov 2024 14:28:07 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=9e7356944da4693e9ceb40bf65ed525048faa106

commit 9e7356944da4693e9ceb40bf65ed525048faa106
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-10-04 15:49:53 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-11-13 14:27:54 +0000

    usb: fix loop in usb_config_parse
    
    By inspection, index increment was missing.
    
    PR:             281843
    Reported by:    Matt Jacobson
    Reviewed by:    bz, markj
    Fixes: e4611d26265f ("usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting.")
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 114080d19973331426cd826f3a961c6ea9216a53)
    (cherry picked from commit ddc9bb706808468b2808ab9a32efc5f8dfb346c9)
---
 sys/dev/usb/usb_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c
index c4fe3b4a6ab6..bce1541ab3ad 100644
--- a/sys/dev/usb/usb_device.c
+++ b/sys/dev/usb/usb_device.c
@@ -855,6 +855,7 @@ usb_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd)
 					if (ep->refcount_alloc != 0)
 						return (USB_ERR_IN_USE);
 				}
+				ep++;
 			}
 		}