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:
yangsong8
2024-10-18 21:47:51 +08:00
committed by Alin Jerpelea
parent 677c2187b9
commit 24d947b7c1
+1 -1
View File
@@ -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 */