Skip to content

Commit 86e62dd

Browse files
fg-cfhnashif
authored andcommitted
net: l2: ieee802154: fix deadlock
When an incoming PAN ID does not match or when an error occurs while sending association requests, then locks were not properly released. Fixes #78495 Signed-off-by: Florian Grandel <[email protected]> (cherry picked from commit 041d8c7)
1 parent d826a69 commit 86e62dd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

subsys/net/l2/ieee802154/ieee802154.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static bool ieeee802154_check_dst_addr(struct net_if *iface, struct ieee802154_m
317317
if (!(dst_plain->pan_id == IEEE802154_BROADCAST_PAN_ID ||
318318
dst_plain->pan_id == sys_cpu_to_le16(ctx->pan_id))) {
319319
LOG_DBG("Frame PAN ID does not match!");
320-
return false;
320+
goto out;
321321
}
322322

323323
if (mhr->fs->fc.dst_addr_mode == IEEE802154_ADDR_MODE_SHORT) {

subsys/net/l2/ieee802154/ieee802154_mgmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ static int ieee802154_associate(uint32_t mgmt_request, struct net_if *iface,
555555
if (ieee802154_radio_send(iface, pkt, pkt->buffer)) {
556556
net_pkt_unref(pkt);
557557
ret = -EIO;
558+
k_sem_give(&ctx->scan_ctx_lock);
558559
goto out;
559560
}
560561

0 commit comments

Comments
 (0)