Received: by 10.223.185.116 with SMTP id b49csp1098761wrg; Fri, 23 Feb 2018 11:55:39 -0800 (PST) X-Google-Smtp-Source: AH8x227T/xHtfk8gTBgJCika7fQS0MAE8zEGsxlxytnANlOI6d7OZeRK0E3/hMAgoSIB3X5WfZKj X-Received: by 10.98.69.76 with SMTP id s73mr2860062pfa.31.1519415739785; Fri, 23 Feb 2018 11:55:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415739; cv=none; d=google.com; s=arc-20160816; b=XdzZCZk90JHvw2kOgBRAdPQV1SXj8HNEKGeFq+BK1lOHSANwuvHvocTX6yNVoDgKIC I3N5Q+HwzExYStayr2CiNG7hfrtdvoto06UTJ0H3KF4LwQy5/8FsRdkWWcxDCx4KSyym eeAAcoBc7lheUn/z7eepLUy8riomBjLo2vwGC5Rd6AIQgpniIzuPXOq3Fdq0BrOkSaBU 4Ic9Ac1/VAWlchATIfUcyDvnOYrJCOZ0SrMme8iBAZ0xFWAtPiWK7FODVT1Fvy2ZR+pO 3KAc/xspeTQwYxA3RtMtBp6FX6Y9sh+Jwk0Tqb+Z4dAJ4DVfHF3bwtmr9W8Ks9KLz5fE mMnw== 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=PPPMMCtCH4D/Dd4Pzz+rw5PY5xKQsuynEpriLlxOdmw=; b=zxn3Pc42ptKcdMEep8VxMXFjTimAfsiiXNjaUulduqaboAx3t/5pUp0vUvIbKW0hUq QoajhgzpB6NbSj8Zp5YQVwWp76LX4z1OhCj+oKDj/zvxctVmw2bFu9mSaWPHShs0J5rK TEf0FS+UZ8/CZvwFfo+TYSQVuiQky5HjO9RuiPL382zHtY6NFbTIjJe72hbTHbX0friK 4iyO9DPw5BbKyiOLAdZ6DeUlBv9x+xEVPZ3GZvuyB6dlunlmYvFt0OI5VTh4+4f2VKl1 AbVEmqkJwAE/7CoSLApLrelcGm/GIPCdP6he+gFTvpYrMsZ/pTCq3s9j2zC71gqYCbtz 42ZQ== 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 t3-v6si2165861plm.224.2018.02.23.11.55.25; Fri, 23 Feb 2018 11:55:39 -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 S933720AbeBWSpI (ORCPT + 99 others); Fri, 23 Feb 2018 13:45:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43208 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933683AbeBWSpE (ORCPT ); Fri, 23 Feb 2018 13:45:04 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id BB5E1122E; Fri, 23 Feb 2018 18:45:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nogah Frankel , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 065/145] net_sched: red: Avoid devision by zero Date: Fri, 23 Feb 2018 19:26:11 +0100 Message-Id: <20180223170733.083856207@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nogah Frankel [ Upstream commit 5c472203421ab4f928aa1ae9e1dbcfdd80324148 ] 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: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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) {