Received: by 10.223.176.5 with SMTP id f5csp802834wra; Sat, 3 Feb 2018 10:37:46 -0800 (PST) X-Google-Smtp-Source: AH8x227GEz6qaE28sHsek6vcpzdd5VTRtifLGBtVc4RS2G68XmYcRAwWlrZVjSlm/QDObGDhf24x X-Received: by 10.98.159.25 with SMTP id g25mr766846pfe.224.1517683066097; Sat, 03 Feb 2018 10:37:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517683066; cv=none; d=google.com; s=arc-20160816; b=uIrg7GBFxBiKsjjDUKZvEVHGbZc5lTqIThdTNUMjIMKQat7mJ2MuGnGdR5LRS3TfZb Dfzg4x28DygVwYdk2soy6RNHtVdJrYjFUFGQ1FqLdwyVGon+GixtIy7bX79yyeEeH2qN bbLcKll24ximcxGWDgU+HhRROg1jrqft1g2/OVPV15KrqrOyZozPV48V4PW9Q6L2NTyd QT6PdrW2EcWyCkRX+6INeCY97jNeqA3NpsLmP5Q8xoutQnYzwVmyc4NsTOYWqZntBP8a 9xTkMI+e4NxJXvDLBTHgIFznPP3K2TPVJv+Q0pAXz0tDSSTJOA6WjtLalWAHLdznGbU8 Eesw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=iw6LNYbsAo9pvhTYRNvMfAXdXmJy1XqpcwpNt4Pcoa0=; b=BeXPZEzJ9EZmxr5x8DuggQNu4CXGDs/4vAy18hplq6+kbVD0NePKjsZ5512RJTHADE sthwmlqhWOsFH8rGv6tVnL7yPj3/1OXxmu/9LkIca8M9ljS7gug2JplcVEPTZPyB0SBm JXNijwjhTOSVZUFh3AGH6xRAUcWzawALUKmYTtedY/1hYtf2kX+dQhe7h857cFMoEcZ7 RYjD2LmuEoZmoRn+Q5vi4ecrXQ5gItmn36uUKHPITXoPj0LEwlpUyTW2yWrWs0Xk4KYo jBaw143yxrimRq0zlChbySNnlgokMBPMYZk8Macj241TjPD6QMl5RTou4VE6zeTdIkRE y8xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MoSvkFJb; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e29si1507008pga.146.2018.02.03.10.37.31; Sat, 03 Feb 2018 10:37:46 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=MoSvkFJb; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754827AbeBCSfn (ORCPT + 99 others); Sat, 3 Feb 2018 13:35:43 -0500 Received: from mail-bl2nam02on0127.outbound.protection.outlook.com ([104.47.38.127]:37417 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752776AbeBCSEI (ORCPT ); Sat, 3 Feb 2018 13:04:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=iw6LNYbsAo9pvhTYRNvMfAXdXmJy1XqpcwpNt4Pcoa0=; b=MoSvkFJbNhPjfHoMFBW6fgBw9YwuAh9xFu+mGcM3cPQejAeMWuodVhHbLgvqmO7Jt1076fJtSrLPrA5eXeidz6ukf+Zi15eQ24PoEQbamFPuez0NaNc0zVSW+yN3nrYwIv/P2caInsrHoslO2oKb7aZB0BN7ryhIWiELi2A6674= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1041.namprd21.prod.outlook.com (52.132.23.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:02:15 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:15 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Luu An Phu , Marc Kleine-Budde , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 089/110] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Thread-Topic: [PATCH AUTOSEL for 4.14 089/110] can: flex_can: Correct the checking for frame length in flexcan_start_xmit() Thread-Index: AQHTnRkBGk12F3PA7EWXjzb70nzRBA== Date: Sat, 3 Feb 2018 18:01:25 +0000 Message-ID: <20180203180015.29073-89-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1041;7:Fe+qUMrxLehlSaE4ydb2SXtsnWnCZClQlengvyErkx05/Y1d/GEOSCqsTdMnIDLgRXZzSxiljx+fv7TSHD063wpGRJhIeISgyyPa4ni2/IYGuvABMG/wpaMekHZ6DLEml6GtL80tT5T/787nnwx9foQMOk7AIhdLBWrPadgD4lue5dJGTwflmH3IqVkrrAbDdR0bNoNg2B96qDhODs/SEcefOGrZRBezAI/DYDZSBM8Wwjy+fdhUCt/2zwmrdvPb x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 362d694f-252a-44da-c7fe-08d56b304217 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1041; x-ms-traffictypediagnostic: BL0PR2101MB1041: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1041;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1041; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(2501003)(305945005)(3660700001)(5250100002)(81156014)(99286004)(81166006)(36756003)(7736002)(8656006)(10290500003)(106356001)(53936002)(5660300001)(316002)(22452003)(8936002)(54906003)(110136005)(3280700002)(478600001)(72206003)(4326008)(25786009)(107886003)(102836004)(97736004)(76176011)(59450400001)(6666003)(66066001)(6506007)(2950100002)(2900100001)(68736007)(8676002)(6116002)(3846002)(186003)(1076002)(6346003)(105586002)(26005)(10090500001)(2906002)(6512007)(86612001)(14454004)(86362001)(6436002)(6486002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1041;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: AiJbNy/BkAoUA91ebtkA4RdNKqFW8+piF+PQN/nyyzgy4nw1rjyjadHkm0TElGL08WYSx70xK5gN0xvQCksxQg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 362d694f-252a-44da-c7fe-08d56b304217 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:25.5346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/can/flexcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index c4d1140116ea..ed8a2a7ce500 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -526,7 +526,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, stru= ct net_device *dev) data =3D be32_to_cpup((__be32 *)&cf->data[0]); flexcan_write(data, &priv->tx_mb->data[0]); } - if (cf->can_dlc > 3) { + if (cf->can_dlc > 4) { data =3D be32_to_cpup((__be32 *)&cf->data[4]); flexcan_write(data, &priv->tx_mb->data[1]); } --=20 2.11.0