Received: by 10.223.185.116 with SMTP id b49csp8508959wrg; Fri, 2 Mar 2018 03:07:47 -0800 (PST) X-Google-Smtp-Source: AG47ELv37KphdmiSD+5cUbPqdWmlR0gHc8rA9VVeAWKnoSoquppy+s2YlKeBy3C3k7Ovsos3MMz5 X-Received: by 10.101.70.203 with SMTP id n11mr4093282pgr.377.1519988867559; Fri, 02 Mar 2018 03:07:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519988867; cv=none; d=google.com; s=arc-20160816; b=KnDmLf7RLeC673PeWvq2tLZ7LT7AyS8o5lp/d/DfhS0rEctder6FR8EWiTwjvMk92G XTGwCeNnFlmkF/6IOexyV5RckQyPLyzIktoJl5g7zELHHzpyUk2cOrG92YuB4fOMZ99O dP2R7+C07xptTnIaRciVfvFP5mKJYMWV4bWFvpOZ/mE6SrjC5Beal4SBmhlhN7rJV8sV DX1eNdcM0+whLyLKXhRlbhVykA4nsFQK7VXFqAXJ7z68Cnm9hGwTlilVr19I9iM0Deds M3uUvikRwZqv8X1XkFX9j5eQBjTe5aP+BkdgNxeds32r+0YZ2rT9fahe/r5sT5K2Xuse zxEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lfsrjHS/Gc4eJxThhMkmH9SrVTT6/eQtnxJ85UkdCOw=; b=fN5sfEp+ic01NR9pgZ72QL9nuYlOV1YhxSo9nb9VILGV6G44lxhF7NafgEg+XUy4b4 WQg2U+CtnLWdiqc4/zLlKkd5Fhi6hO7LeSi10dkRIcOwpppRwInj+k8zVT+uJsjXDG2H CAKq5uyv5zSVjOtNIPV0QkP38RupwCN/wVQrYqsSfkfeSwNo44FVu3X5UAwQnur8NFvf cBcI6tl5arWzhXnpl8rrwJH+QG5NDxHcULeS4DS+1/TVWrGkmwcq4q6o+jl0Lxub9yB/ q2t4B3Je5QDDsJ2HeJDdcxAiQ8+aT2T4srOz5h+JDDCrRX0TmMp+1G/0B5aZLrWxN6h3 bDUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si3874882pgf.365.2018.03.02.03.07.32; Fri, 02 Mar 2018 03:07:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423595AbeCBIzD (ORCPT + 99 others); Fri, 2 Mar 2018 03:55:03 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50602 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423524AbeCBIy6 (ORCPT ); Fri, 2 Mar 2018 03:54:58 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 888DB121A; Fri, 2 Mar 2018 08:54:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luu An Phu , Oliver Hartkopp , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.4 25/34] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Date: Fri, 2 Mar 2018 09:51:21 +0100 Message-Id: <20180302084437.652137759@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302084435.842679610@linuxfoundation.org> References: <20180302084435.842679610@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luu An Phu [ 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 Reviewed-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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, ®s->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, ®s->mb[FLEXCAN_TX_BUF_ID].data[1]); }