[PATCH BlueZ v2 1/3] mesh: Fix to send close indication on timeout

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

 



From: Prathyusha N <prathyusha.n@xxxxxxxxxxx>

If pb_session is freed in timeout, close indication will not be sent.
pb_session is freed in pb_adv_unreg() and hence removed from tx_timeout.
Added acceptor_free() in acp_prov_close() to ensure pb_session is freed.
---
 mesh/pb-adv.c        | 2 --
 mesh/prov-acceptor.c | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 19d14532a..586cd7f15 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -175,8 +175,6 @@ static void tx_timeout(struct l_timeout *timeout, void *user_data)
 	l_info("TX timeout");
 	cb = pb_session->close_cb;
 	user_data = pb_session->user_data;
-	l_free(pb_session);
-	pb_session = NULL;
 	cb(user_data, 1);
 }
 
diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
index bca019358..03972c227 100644
--- a/mesh/prov-acceptor.c
+++ b/mesh/prov-acceptor.c
@@ -121,6 +121,7 @@ static void acceptor_free(void)
 static void acp_prov_close(void *user_data, uint8_t reason)
 {
 	/* TODO: Handle Close */
+	acceptor_free();
 }
 
 static void prov_to(struct l_timeout *timeout, void *user_data)
-- 
2.21.0




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux