Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp658909ybg; Thu, 19 Mar 2020 06:33:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvWhW6LLXIfZFYKpsCf3wnWnMctDYB5PM0Fii7DdWWas8Ea2UW9cxQCe2J/jqxy+Dt/PqS3 X-Received: by 2002:aca:c78e:: with SMTP id x136mr2305527oif.116.1584624784142; Thu, 19 Mar 2020 06:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584624784; cv=none; d=google.com; s=arc-20160816; b=Rm21gFmbi7G0crH8CtV0EoKuNYdnULUeJc51/aN0DR5DlahhEQ4ssmq0I1tTzdonjO ou8PuKP9z3iTUeBdESamiV8EQ0L0Vwh33WTVrJjsTGqj6P/7NtCQTewbNKcRUxaX1rCk B3+GZ31CPmN9DjP+GRGNAn8lL5tezyrFG0pHRu8CeK8opJ7mNhS2qMrd12uj0w2c3h3D ahvExDo022EtgCnq9tLYq3Tb1EvoApSy9iPzsYiZ54Kpl4Oi9DnYqlFb24KglL+hfB8j SlR0dk9pBNtEiy7EUZ2NbJ4HwaihV/E4zMbLWT3u5neor3qZqMvfr1NTvcYsaikhDfdM yzdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wg51l8Gyh1ZmYMGd502AJJJEkcVmu5hoQfzApuE8/84=; b=NDIjuZyoFmhoJ5fEI2FRQRcoqi/ClFb2caG40L5I8pX0BDq9p99QAgQAZhlQt9sq5m NbSNzulGSV+441ILKT2/OG8ihJRqLnOW760y3Wt8W8rkv7uKIurSr/kr97IjvVAxLZam E4JEW3hSHTeQoPQR3vTdMNlP3GU2p6HbENibu4HVAMIUJX535CJ6Hh9q4vUTnIk2GVp/ mB2cXkBQZd+FqPvJl27Y/iytbr4YQfks4P3QFx/bHjDLDMBZoFLRpiCnphk3mEDuJS7u EdreIWoMRvvb875umySRPAD3oUouLiE2NgclQJFMdCuqw4GSFpZ1vfmM1Y6T6uV72TtV TNmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P4xp1pMu; 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 v10si1170251oth.136.2020.03.19.06.32.50; Thu, 19 Mar 2020 06:33:04 -0700 (PDT) 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=@kernel.org header.s=default header.b=P4xp1pMu; 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 S1727494AbgCSNPe (ORCPT + 99 others); Thu, 19 Mar 2020 09:15:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:35292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729402AbgCSNP1 (ORCPT ); Thu, 19 Mar 2020 09:15:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2ABAD20787; Thu, 19 Mar 2020 13:15:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584623726; bh=9xBXI2zA3y1pn93vgSUUtgTS2XXTyTJNZqWiOC1ufwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4xp1pMuF6SO3cl1l7PJ4AdRmAACLLSNZnq1kr3NO7qfCMBrixjZ8ylKo6zuybXgj aUvJS8N+q9ItA9kQwtuqK5+rXV5MVuNdvPbEgME6HMejctu5SbHjxWjbboFf5o3xCU 0Rvb/4o9yTm2JkE4pGCqsZk+5nx+CCLV0Zoyyb04= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , Fugang Duan , "David S. Miller" Subject: [PATCH 4.14 31/99] net: fec: validate the new settings in fec_enet_set_coalesce() Date: Thu, 19 Mar 2020 14:03:09 +0100 Message-Id: <20200319123951.159284234@linuxfoundation.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200319123941.630731708@linuxfoundation.org> References: <20200319123941.630731708@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski [ Upstream commit ab14961d10d02d20767612c78ce148f6eb85bd58 ] fec_enet_set_coalesce() validates the previously set params and if they are within range proceeds to apply the new ones. The new ones, however, are not validated. This seems backwards, probably a copy-paste error? Compile tested only. Fixes: d851b47b22fc ("net: fec: add interrupt coalescence feature support") Signed-off-by: Jakub Kicinski Acked-by: Fugang Duan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/fec_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2478,15 +2478,15 @@ fec_enet_set_coalesce(struct net_device return -EINVAL; } - cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr); + cycle = fec_enet_us_to_itr_clock(ndev, ec->rx_coalesce_usecs); if (cycle > 0xFFFF) { pr_err("Rx coalesced usec exceed hardware limitation\n"); return -EINVAL; } - cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr); + cycle = fec_enet_us_to_itr_clock(ndev, ec->tx_coalesce_usecs); if (cycle > 0xFFFF) { - pr_err("Rx coalesced usec exceed hardware limitation\n"); + pr_err("Tx coalesced usec exceed hardware limitation\n"); return -EINVAL; }