poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ios_close: Update the current IOS only if it is the one being cl


From: Egeyar Bagcioglu
Subject: [PATCH] ios_close: Update the current IOS only if it is the one being closed.
Date: Tue, 12 May 2020 23:55:50 +0200

2020-05-12  Egeyar Bagcioglu  <address@hidden>

        * libpoke/ios.c (ios_close): Update the current IOS
        only when closing the current IOS.
---
 libpoke/ios.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libpoke/ios.c b/libpoke/ios.c
index 9cb1cb56..d84db285 100644
--- a/libpoke/ios.c
+++ b/libpoke/ios.c
@@ -196,10 +196,12 @@ ios_close (ios io)
         ;
       tmp->next = io->next;
     }
-  free (io);
 
   /* Set the new current IO.  */
-  cur_io = io_list;
+  if (io == cur_io)
+    cur_io = io_list;
+
+  free (io);
 }
 
 uint64_t
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]