From ade6cc4a7176f4d0773ed736788495aca2f8e7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Sat, 2 Jan 2021 16:19:30 +0100 Subject: [PATCH] canbus: isotp: fix asserts to check rx and tx addr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous implementation contained a typo so that only the rx address was checked. Signed-off-by: Martin Jäger --- subsys/canbus/isotp/isotp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/canbus/isotp/isotp.c b/subsys/canbus/isotp/isotp.c index 05f4e084bff..a72de83f6a7 100644 --- a/subsys/canbus/isotp/isotp.c +++ b/subsys/canbus/isotp/isotp.c @@ -557,7 +557,7 @@ int isotp_bind(struct isotp_recv_ctx *ctx, const struct device *can_dev, __ASSERT(ctx, "ctx is NULL"); __ASSERT(can_dev, "CAN device is NULL"); - __ASSERT(rx_addr && rx_addr, "RX or TX addr is NULL"); + __ASSERT(rx_addr && tx_addr, "RX or TX addr is NULL"); __ASSERT(opts, "OPTS is NULL"); ctx->can_dev = can_dev; @@ -1106,7 +1106,7 @@ static int send(struct isotp_send_ctx *ctx, const struct device *can_dev, __ASSERT_NO_MSG(ctx); __ASSERT_NO_MSG(can_dev); - __ASSERT_NO_MSG(rx_addr && rx_addr); + __ASSERT_NO_MSG(rx_addr && tx_addr); if (complete_cb) { ctx->fin_cb.cb = complete_cb;