Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3673186pxv; Mon, 26 Jul 2021 09:08:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/JUwU9mBNyF7OxcjgVrl3qxj5xCS7hWPZT8HLTbKejJP5yboW3kXC1Pl65IbwFHs2u+4K X-Received: by 2002:a17:906:af7c:: with SMTP id os28mr17897082ejb.341.1627315720291; Mon, 26 Jul 2021 09:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315720; cv=none; d=google.com; s=arc-20160816; b=aR/QL0nMo3i+UF+UmLndUEyRjmdQmWas0lIVG6A2A4O8EHih9z4/O50Z6VyTRfAu9N wzVH0vMj2t/u9Mvk/+E3eRQJ1ZllmRPFvxR4zzPN4syz7wJ3cyo9MDdKBWA3rFNNsw/0 eHPuW1hl8Zd8ZvYzKfdZo8ARNrqrUINf7ZFgf5ZtaIFh4fZlx3GjaNfTTaTMPMNXvP6v yqW7wJd9Zcp1lS9QZ2paqr9MNkuvEfrmOGIVnfbRe//z28rRxDnmFgIsF99aHN79Ds/Y VsT4l4tHT2NsC+UorNKaFtTkflSdVryxh/A2kszyDoP9S+QClT9zZodAnFlCf4HY68sK LPog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=63iWBDEzP1EeNbu9gytisSmWwp810cCh9rUEDdp31fM=; b=pR7NFAM4PQL/cUCkKd/eyHSW0+hrhWFPfbudoFYL9H7vXIsWeJ1PSCa7NfcYZog914 WDmODc/RcEoHMBi/s4vi6ah14P/71ET8//mzpP/ZQy0Zts2CIFLUdd++erdxYwYlxD8A w6DWcazZmkXRq2FS0PKUi94pZbt/jiiP76rOM5tAn1nmuR3AaPkjQTDbmeHOGNSheTfN rOgnr5ZlLuUqgvuZHzdTTOxOTOJq5YhYkkVhspte+suDLPVBIPFLZxaBu7WvnT1ad0qs pU/wc1rdy7KRCI7CEAXucKDEiOTvIWD1c5v9TWVF/mGJb5JU4rHbzTqLE9KHFC+ryJrC wHsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rRUq7YDp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zm10si326589ejb.633.2021.07.26.09.08.16; Mon, 26 Jul 2021 09:08:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rRUq7YDp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237381AbhGZPWg (ORCPT + 99 others); Mon, 26 Jul 2021 11:22:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:52856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237418AbhGZPPo (ORCPT ); Mon, 26 Jul 2021 11:15:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C5BB161039; Mon, 26 Jul 2021 15:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314898; bh=7yDrel2kxKSR84AmBUbcwptA1ONeO9rasT8y1zlTTkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rRUq7YDpOM9Pw/HvSvk/BExShFugX3cNrBOX1McNqPubPBJ8meOmUsbZLN9Bqiec3 RUboNz1AMzSOW4aGJKgKytCCqL5XbrRUA3/WdBJmIALUt4FoaEBPeAlpqfONzJBcNb NL3n6a/BR8PcUu2R1E3ISeP9W2rHZYd6ns28SFZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jedrzej Jagielski , Vinicius Costa Gomes , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.4 012/108] igb: Fix position of assignment to *ring Date: Mon, 26 Jul 2021 17:38:13 +0200 Message-Id: <20210726153832.095278453@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jedrzej Jagielski [ Upstream commit 382a7c20d9253bcd5715789b8179528d0f3de72c ] Assignment to *ring should be done after correctness check of the argument queue. Fixes: 91db364236c8 ("igb: Refactor igb_configure_cbs()") Signed-off-by: Jedrzej Jagielski Acked-by: Vinicius Costa Gomes Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 35b096ab2893..158feb0ab273 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -1694,14 +1694,15 @@ static bool is_any_txtime_enabled(struct igb_adapter *adapter) **/ static void igb_config_tx_modes(struct igb_adapter *adapter, int queue) { - struct igb_ring *ring = adapter->tx_ring[queue]; struct net_device *netdev = adapter->netdev; struct e1000_hw *hw = &adapter->hw; + struct igb_ring *ring; u32 tqavcc, tqavctrl; u16 value; WARN_ON(hw->mac.type != e1000_i210); WARN_ON(queue < 0 || queue > 1); + ring = adapter->tx_ring[queue]; /* If any of the Qav features is enabled, configure queues as SR and * with HIGH PRIO. If none is, then configure them with LOW PRIO and -- 2.30.2