This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 24d947b7c1 ptmx: When alloc minor, skip the start addr if it has been 
used
24d947b7c1 is described below

commit 24d947b7c14e7f3ad712c5b3743d4bc36f30e7a6
Author: yangsong8 <[email protected]>
AuthorDate: Fri Oct 18 21:47:51 2024 +0800

    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 <[email protected]>
---
 drivers/serial/ptmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/serial/ptmx.c b/drivers/serial/ptmx.c
index edb4f381f3..f38da9c93f 100644
--- a/drivers/serial/ptmx.c
+++ b/drivers/serial/ptmx.c
@@ -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 */
 

Reply via email to