Received: by 10.223.185.116 with SMTP id b49csp6386214wrg; Wed, 28 Feb 2018 08:33:41 -0800 (PST) X-Google-Smtp-Source: AH8x226mRpYeL+mOJVJkZptFt0+TQWaHcqLzrnEtvB3BHxjpv9J2WGeb0anGVDU6KD1FU/Jisj08 X-Received: by 10.101.102.83 with SMTP id z19mr14377028pgv.75.1519835621144; Wed, 28 Feb 2018 08:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519835621; cv=none; d=google.com; s=arc-20160816; b=Y3zFSh7O3+FjlsJOPJ8CdcxUdNbAIjD8P6iUrD7euFjqQ8zHudNekcmKgCawhVVz7Y dumUCWofvfU0fBJb5cy/GZO8feHZ6MRABhAuhy93dvZkrwglQZnKOXLR21GaN2q2rWtI ZUqYqPkSRAn5YVUhccpraCWFQWGJdZf45frWG01TeP/xHaBOu8fqcSn6eitF3GgQH00u ZeRenYgxD5pZCc/8PDl5pRMWBFLQhibYABn24RkyL1oGW9g2rCHkRA8muby9cmTrnppW 90/RG4NhA9pGkYyOX9rWLkdq9VO6U0rFBFhFH2OVR5blZzCxRhZwDEHBvNyWxSev+S2X bagg== 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=7Oa59h22MJV28hgCxtxCTsJuL0NHYsUJYtcoaP+IwMs=; b=CYoxqROQTZzBR7OIl7e5WffoiEnC6Y9NCrAp256AGo44ZFLyhFB2ug9saG13X5JTpZ QXK9J80lrg6EoLaExSsE0sXNhFdx2aPP7SvAm+Oklq7GL6BfBZ4qoOpV8ZAsH/ossMUf sqq+71rZD/4E/g8kcC9IZF/LAR6qEeXFMG1E13MCR3NEGLHkd/zz6h8zH5xXXJC+84Z0 rf0CIF3Y0xgdHWLfIUcS3JTaW1WcT9PHetScPvSeM0SVTHkG7EhQqbaAWyUdDmh2sa77 J8+DiGpg7ipt45oHLWm7/ZtjuQNZKpk9Njgubos+L+CSLSUB8IOIH0oak6IWl/p0JiNK QdUA== 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 t64si1207732pgb.294.2018.02.28.08.33.25; Wed, 28 Feb 2018 08:33:41 -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 S933834AbeB1QOn (ORCPT + 99 others); Wed, 28 Feb 2018 11:14:43 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:35120 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934447AbeB1QOl (ORCPT ); Wed, 28 Feb 2018 11:14:41 -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 1er3Yu-0006XP-3M; Wed, 28 Feb 2018 15:22:32 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Ye-0008RW-L3; 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, "Nogah Frankel" , "David S. Miller" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 056/254] net_sched: red: Avoid devision by zero 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: Nogah Frankel commit 5c472203421ab4f928aa1ae9e1dbcfdd80324148 upstream. Do not allow delta value to be zero since it is used as a divisor. Fixes: 8af2a218de38 ("sch_red: Adaptative RED AQM") Signed-off-by: Nogah Frankel Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- include/net/red.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/red.h +++ b/include/net/red.h @@ -178,7 +178,7 @@ static inline void red_set_parms(struct p->qth_max = qth_max << Wlog; p->Wlog = Wlog; p->Plog = Plog; - if (delta < 0) + if (delta <= 0) delta = 1; p->qth_delta = delta; if (!max_P) {