linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Gix <brian.gix@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: inga.stotland@intel.com, brian.gix@intel.com
Subject: [PATCH BlueZ v3 6/6] mesh: Fix race condition memory leak
Date: Wed, 19 May 2021 12:09:25 -0700	[thread overview]
Message-ID: <20210519190925.1723012-7-brian.gix@intel.com> (raw)
In-Reply-To: <20210519190925.1723012-1-brian.gix@intel.com>

This is a minor fix of a memory leak triggered on process exit if
proceess has been killed right after requesting an outbound
advertisement be sent.  It is harmless, but will cause an occasional
static analysis failure.
---
 mesh/mesh-io-generic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 4eb7f27ce..6c0b8f0fd 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -462,7 +462,9 @@ static bool dev_destroy(struct mesh_io *io)
 	bt_hci_unref(pvt->hci);
 	l_timeout_remove(pvt->tx_timeout);
 	l_queue_destroy(pvt->rx_regs, l_free);
+	l_queue_remove_if(pvt->tx_pkts, simple_match, pvt->tx);
 	l_queue_destroy(pvt->tx_pkts, l_free);
+	l_free(pvt->tx);
 	l_free(pvt);
 	io->pvt = NULL;
 
-- 
2.25.4


      parent reply	other threads:[~2021-05-19 19:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 19:09 [PATCH BlueZ v3 0/6] OOB Authentication improvements Brian Gix
2021-05-19 19:09 ` [PATCH BlueZ v3 1/6] mesh: Fix delivery of PB-ACK to acceptors Brian Gix
2021-05-19 19:43   ` OOB Authentication improvements bluez.test.bot
2021-05-19 19:09 ` [PATCH BlueZ v3 2/6] mesh: Normalize endian of public/private ECC keys Brian Gix
2021-05-19 19:09 ` [PATCH BlueZ v3 3/6] tools/mesh: Add all supported OOB methods to cfgclient Brian Gix
2021-05-19 19:09 ` [PATCH BlueZ v3 4/6] test/mesh: Add support for testing more OOB auth Brian Gix
2021-05-19 19:09 ` [PATCH BlueZ v3 5/6] mesh: Add single threading to prov-acp ob messaging Brian Gix
2021-05-19 19:09 ` Brian Gix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519190925.1723012-7-brian.gix@intel.com \
    --to=brian.gix@intel.com \
    --cc=inga.stotland@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).