Commit e267abdc authored by Erik Brockhoff's avatar Erik Brockhoff Committed by Johan Hedberg
Browse files

Bluetooth: controller: fix node_rx retention mechanism

Ensure that in LLCP reference to node_rx is cleared when
retention is NOT used, to avoid corruption of node_rx later
re-allocated

Signed-off-by: default avatarErik Brockhoff <erbr@oticon.com>
(cherry picked from commit 806a4fcf)
Signed-off-by: default avatarVinayak Kariappa Chettimada <vich@nordicsemi.no>
parent 3ddd2734
Loading
Loading
Loading
Loading
+5 −0
Changes for subsys/bluetooth/controller/ll_sw/ull_llcp_local.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -318,6 +318,11 @@ void llcp_lr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link,
		break;
	}

	/* If rx node was not retained clear reference */
	if (ctx->node_ref.rx && ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) {
		ctx->node_ref.rx = NULL;
	}

	llcp_lr_check_done(conn, ctx);
}

+6 −0
Changes for subsys/bluetooth/controller/ll_sw/ull_llcp_remote.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -313,6 +313,12 @@ void llcp_rr_rx(struct ll_conn *conn, struct proc_ctx *ctx, memq_link_t *link,
		LL_ASSERT(0);
		break;
	}

	/* If rx node was not retained clear reference */
	if (ctx->node_ref.rx && ctx->node_ref.rx->hdr.type != NODE_RX_TYPE_RETAIN) {
		ctx->node_ref.rx = NULL;
	}

	llcp_rr_check_done(conn, ctx);
}