From ad7ce90af771ff022bfd1d647ea8cdc35d0d503b Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Mon, 16 Dec 2013 08:54:14 +0100 Subject: [PATCH] sllin: Evaluate message upon break only if received at least a LIN ID Signed-off-by: Alexander Stein --- sllin/sllin.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sllin/sllin.c b/sllin/sllin.c index 61c8134..8d7ad69 100644 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@ -716,10 +716,12 @@ static void sllin_slave_receive_buf(struct tty_struct *tty, if (fp && *fp++) { /* * If we don't know the length of the current message - * we received the break of the next message. - * Evaluate the previous one before continuing + * and received at least the LIN ID, we received here + * the break of the next message. + * Evaluate the previous one before continuing. */ - if (sl->rx_len_unknown == true) + if ((sl->rx_len_unknown == true) && + (sl->rx_cnt >= SLLIN_BUFF_ID)) { hrtimer_cancel(&sl->rx_timer); sllin_slave_finish_rx_msg(sl); -- 2.39.2