sllin: Evaluate message upon break only if received at least a LIN ID
authorAlexander Stein <alexander.stein@systec-electronic.com>
Mon, 16 Dec 2013 07:54:14 +0000 (08:54 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 16 Jan 2014 23:51:39 +0000 (00:51 +0100)
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
sllin/sllin.c

index 61c8134..8d7ad69 100644 (file)
@@ -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);