Received: by 10.223.185.116 with SMTP id b49csp6328942wrg; Wed, 28 Feb 2018 07:39:42 -0800 (PST) X-Google-Smtp-Source: AH8x225acKOQMJLJ9a9BieMxCFa4B7GJ9wIJU9r/Brmymwy7dQ8zGl9i//jIukvGoo6mzcvfJ9S3 X-Received: by 2002:a17:902:b210:: with SMTP id t16-v6mr18299716plr.373.1519832382192; Wed, 28 Feb 2018 07:39:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519832382; cv=none; d=google.com; s=arc-20160816; b=KCMyMuCdOpaU4MmSaLIKMGV5DmkRY8ngILJD4yp4uj3zyKO/p71bWwJEfbckqPMf0E 7r/wZ9/iLwiLlR2RfMkXQKRgpzbKADIUxIgYbE44z8e6WDvleFl2FLbedLD7GjBokDAw d8M3+ISxl5rYv5ygLQZqAj4UKuUBCCDpg8aB75lSvb4WO9XnwFdh+s/wFqz6BG/pSggn hrQBs1Sy0/o0XZolcpcfX16M7bSY+F8FZXxnqZZ0/zd/d0yhdIvkzyankwqUTr0Rf4Hx f7opSK+M3YwDc+mDkkFSIu7it8+UDPkb3E8YOAbHnCx+xtwlygoL8PwwIohPxM/E/aWa X3Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=iBxxcKZ0rhMikc1diWBU44Bpo7MVZ82CbMZQrpOGeUY=; b=ha3HZde+OmnuMZKyN/JP9TTwlQ8Ybu1usT6fcxpAUB4r3nri0VTbVq/yMidFyF6lYe J4qV2IHWS5/nh6oQ3EqYK++a5BErPv5Sd4kPG2IzYn4mg7WeCN97EKbw7tewFCuwvAEv 3ArPb/nk+0MpGZ7yHgmehHNFK1ezdqCvddmOrSn2B05mqEkzgav0vA5mSgxkr26W0HAd 3v6TfCTSj9Sbq+Vn/1i5R61SrKTGa3YR1OKsAsEz3IcmVbAaUdoqh5D6Eu9RT/kPRYTH YfpsAK6AEY8sdUdaEdscHs484nEq/1frIzFvIp/oLCvcvCQfkDFoHPU2ENQpL6qA+IiF 9W1Q== 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 z188si1160436pgb.592.2018.02.28.07.39.27; Wed, 28 Feb 2018 07:39:42 -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 S933337AbeB1Pgs (ORCPT + 99 others); Wed, 28 Feb 2018 10:36:48 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33256 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752742AbeB1PWe (ORCPT ); Wed, 28 Feb 2018 10:22:34 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yf-0006XS-E2; Wed, 28 Feb 2018 15:22:17 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Ye-0008Pp-4q; Wed, 28 Feb 2018 15:22:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Marc Kleine-Budde" , "Jimmy Assarsson" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 043/254] can: kvaser_usb: ratelimit errors if incomplete messages are received In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jimmy Assarsson commit 8bd13bd522ff7dfa0eb371921aeb417155f7a3be upstream. Avoid flooding the kernel log with "Formate error", if incomplete message are received. Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde Signed-off-by: Ben Hutchings --- drivers/net/can/usb/kvaser_usb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c @@ -417,8 +417,8 @@ static int kvaser_usb_wait_msg(const str } if (pos + tmp->len > actual_len) { - dev_err(dev->udev->dev.parent, - "Format error\n"); + dev_err_ratelimited(dev->udev->dev.parent, + "Format error\n"); break; } @@ -1001,7 +1001,8 @@ static void kvaser_usb_read_bulk_callbac } if (pos + msg->len > urb->actual_length) { - dev_err(dev->udev->dev.parent, "Format error\n"); + dev_err_ratelimited(dev->udev->dev.parent, + "Format error\n"); break; }