Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp673175img; Fri, 22 Mar 2019 06:20:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKcq04FSIBKrSs+MEPrsf86CWBZwmmiSV7aHutOplVlSzzruNgKrsHWAPJVYlasR+tVMng X-Received: by 2002:aa7:8609:: with SMTP id p9mr9162032pfn.166.1553260802189; Fri, 22 Mar 2019 06:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553260802; cv=none; d=google.com; s=arc-20160816; b=y1uSiFn3l5ijM9V/EAFDSmkMbaqhhuF0l5uZAPzTq8RNFCI/YFEVVWNw0dsvE8FQ8S h2rma/l3fhGJe+ADssGM3pUl15fYAfTNdCSCJMfXmBAn1BvVAimjJfau8s3tqseSeDFM Pq49AUXUrcbR62n5AVysCgfuGgU1QADBRN/2zxn1aksmDJ5K8kdLhsubpdHVdFIjHHkl ebbXaZr1398F6SIzxksFX7zSSGkbiftvGZfp/F6jYBJRvtB5dCSdWI88lki0HHFQzky0 0iydV9d3RTVAUMPYJhQ4CQ292xlxGLN1nnSmU1dNI909G1+pgGksaQzqnrRFD1mgoVy9 uwMA== 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=YRUaFgpP+3m+geE346hg7D3GZrCrnJI2b8H5uzdrz9o=; b=fDOvoPWHbtGIdLAB18CLkHaV1Kodz2oZQgp3Q0+zpeZjvtWxPzKAyAvcKsUWqvqS4l BGvDBp3hdczdzR05X0XEodku+vztT1Qz8McMPAOHz8S12wc5YOHrg8ROqUIrgmWBFH1k cfebhpUIk+wa674J9C8VPhqCwJM0kOwerG4qLn+8U+58AnHPlvmGSNfrIRmyj136Zh6Y B4cROGOBOz7DfGowLRkDPJJmNvFzwtnGJW60Mcl3D+RCu7tXym2iwxr+4xKAwQS7uG4E VBRpnuxUXuEXKjPGLR5VDXjis7Z4vd+m33j2UuYXDPM0OkKIyhGggxQm2jYg6fJVOAtm lFiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JFId2uLl; 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 s194si6699022pgs.47.2019.03.22.06.19.44; Fri, 22 Mar 2019 06:20:02 -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=JFId2uLl; 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 S1729241AbfCVLZJ (ORCPT + 99 others); Fri, 22 Mar 2019 07:25:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:52414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728215AbfCVLZI (ORCPT ); Fri, 22 Mar 2019 07:25:08 -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 991BB20657; Fri, 22 Mar 2019 11:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253908; bh=2gOdk0SUeovtxMjK8WXtt37c9Ia0hyewpQjb8nEvTng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JFId2uLlqTJjKOKUpHOR7ukDUG8yltxFv3OS2dcDzNFroOIZTXaH0MRRysz4rJpVB 3pzoiPyDuaCKsm7K/60+S/xx1vzBpL8cng9sezee/AyqLS57pKNSPrkJga17RvF33p Q1RD+9WWlwP0D9cJikGL76G/UPBY3F3eFPNGx01A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mao Wenan , "David S. Miller" , Sasha Levin Subject: [PATCH 3.18 108/134] net: set static variable an initial value in atl2_probe() Date: Fri, 22 Mar 2019 12:15:21 +0100 Message-Id: <20190322111218.145540719@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4593403fa516a5a4cffe6883c5062d60932cbfbe ] cards_found is a static variable, but when it enters atl2_probe(), cards_found is set to zero, the value is not consistent with last probe, so next behavior is not our expect. Signed-off-by: Mao Wenan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/atheros/atlx/atl2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/net/ethernet/atheros/atlx/atl2.c +++ b/drivers/net/ethernet/atheros/atlx/atl2.c @@ -1338,13 +1338,11 @@ static int atl2_probe(struct pci_dev *pd { struct net_device *netdev; struct atl2_adapter *adapter; - static int cards_found; + static int cards_found = 0; unsigned long mmio_start; int mmio_len; int err; - cards_found = 0; - err = pci_enable_device(pdev); if (err) return err;