aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakanori Watanabe <takawata@FreeBSD.org>2021-05-26 09:23:33 +0000
committerTakanori Watanabe <takawata@FreeBSD.org>2021-06-28 04:00:51 +0000
commit7bbd5ebae80b52a87d62164a04221752efa8fd50 (patch)
treeec397d0b5db2a0fc746b88fb1ff2e9d326163101
parenta35615900cf525d1b4318837ccd4ce32fdf0fe5c (diff)
downloadsrc-7bbd5ebae80b52a87d62164a04221752efa8fd50.tar.gz
src-7bbd5ebae80b52a87d62164a04221752efa8fd50.zip
Fix a use-after-free in an error case.
PR: 255872 Submitted by: lylgood Differential Revision: https://reviews.freebsd.org/D30454 (cherry picked from commit 14803ec8d193d8d46f4137a7dba61b277c6a2fed)
-rw-r--r--sys/netgraph/bluetooth/hci/ng_hci_evnt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
index 1c1aeee3b6b2..78f8d9e121b3 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
@@ -509,6 +509,7 @@ static int le_connection_complete(ng_hci_unit_p unit, struct mbuf *event)
if (error != 0) {
ng_hci_con_untimeout(con);
ng_hci_free_con(con);
+ goto out;
}
} else if ((error = ng_hci_con_untimeout(con)) != 0)