mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
ptmx: When alloc minor, skip the start addr if it has been used
The alloctab can be looped, if the first check the corresponding bit is set, it will not continue to loop Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
@@ -151,7 +151,7 @@ static int ptmx_minor_allocate(void)
|
||||
* prevent (unexpected) infinite loops.
|
||||
*/
|
||||
|
||||
if (startaddr == minor)
|
||||
if (startaddr == g_ptmx.px_next)
|
||||
{
|
||||
/* We are back where we started... the are no free device address */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user