4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luu An Phu <phu.lu...@nxp.com>


[ Upstream commit 13454c14550065fcc1705d6bd4ee6d40e057099f ]

The flexcan_start_xmit() function compares the frame length with data
register length to write frame content into data[0] and data[1]
register. Data register length is 4 bytes and frame maximum length is 8
bytes.

Fix the check that compares frame length with 3. Because the register
length is 4.

Signed-off-by: Luu An Phu <phu.lu...@nxp.com>
Reviewed-by: Oliver Hartkopp <socket...@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <m...@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.le...@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/net/can/flexcan.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -493,7 +493,7 @@ static int flexcan_start_xmit(struct sk_
                data = be32_to_cpup((__be32 *)&cf->data[0]);
                flexcan_write(data, &regs->mb[FLEXCAN_TX_BUF_ID].data[0]);
        }
-       if (cf->can_dlc > 3) {
+       if (cf->can_dlc > 4) {
                data = be32_to_cpup((__be32 *)&cf->data[4]);
                flexcan_write(data, &regs->mb[FLEXCAN_TX_BUF_ID].data[1]);
        }


Reply via email to