mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
m66591: Fix out-of-bounds array access
Loop terminator needed a preincrement rather than postincrement, and also used a proper #define instead of a magic number. Change-Id: Iafd6a0dce0304cb94e4f1d04cce46d2ca603507a
This commit is contained in:
parent
b450707955
commit
f0ac5d123f
1 changed files with 7 additions and 7 deletions
|
|
@ -662,10 +662,10 @@ int usb_drv_request_endpoint(int type, int dir) {
|
||||||
|
|
||||||
pipecfg |= 1<<13;
|
pipecfg |= 1<<13;
|
||||||
|
|
||||||
while(M66591_eps[ep].busy && ep++<7);
|
while(M66591_eps[ep].busy && ++ep<USB_NUM_ENDPOINTS);
|
||||||
|
|
||||||
/* If this reached 7 the endpoints were all busy */
|
/* If this reached USB_NUM_ENDPOINTS the endpoints were all busy */
|
||||||
if(ep==7) {
|
if(ep==USB_NUM_ENDPOINTS) {
|
||||||
logf("mxx: ep %d busy", ep);
|
logf("mxx: ep %d busy", ep);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue