Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3242113imc; Wed, 13 Mar 2019 12:30:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi7d9uKMgRX1HlzttEhaZaamUz+Uu66Dbhg6Nq7VEAPlVucPIl9lbFR6t1I0elexWW85wc X-Received: by 2002:a63:fc49:: with SMTP id r9mr41343023pgk.447.1552505438116; Wed, 13 Mar 2019 12:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552505438; cv=none; d=google.com; s=arc-20160816; b=SmiGlNHveuL8Ltp+ekTrRq2JLVZYk+R1hw5FuSuCb7bxQ35OywzIdGlv6hF4avcPsE 5gWsytzfrVe4n48lYkLIt3CooTDMkQMBBdnaUMExqIu+CAhJ3UIagoRDG0xVOK5UVyum BN7K9J5bhDS68L0B4vOvOy1610yL71gEeZR9q/SRcTQYlGQIIDEuxeffVvmDvTS5X9PT +VzcoEpA5U7QuARR3QhRYAuMCM0w1Cr5XkbSWU+oDSEq7vlBjlnely7vz1yTXYcztvRH 6GBXZzxFRZdKe0FyVWsdukx/GQc4s8BBHrzZNuMFDiizTOeMqA98LMDCoh14Wu/oHXrx l19g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RIPHYEg6eYusQMe7mWp1zgwsNk6CDbmdCMNdIPP05Jk=; b=sfzQMGkeJ3UVFIzD8KUnjWfsK3T+aM7Wxi1iLFsQ/HeM0WaFYSI8+utiaBEtDi/I19 /kWChbD0K40K3O/jV7Q2zHktrmkipm9RGy/ev2A/PzvUn81sCO15zEOYT65ho1x2qZc+ BKOvakULcktMmuyIGgWRABCFJE6AzfQHwf7PsE+HeXflr8ZXEQwJmFpwfIyBWvh8VBNg i+byc1WnfCkGq+5gMrD+sh0869Bep+tey2UJt555sZwrShF77qoVV+sWbE8ZWhIpmOcD cu8pSIyPlj9z6hed4m9RCeqwJUveUViho9huRHn+uuQ03qy9cdePuts5hhlz00qoEBaE 8isw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uzrUYB1o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q130si11885100pfq.97.2019.03.13.12.30.22; Wed, 13 Mar 2019 12:30:38 -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=uzrUYB1o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727844AbfCMTMv (ORCPT + 99 others); Wed, 13 Mar 2019 15:12:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:43392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbfCMTMq (ORCPT ); Wed, 13 Mar 2019 15:12:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10D942173C; Wed, 13 Mar 2019 19:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504366; bh=qjJJI4+d5v2AvIUSdKoW+tK0QAIb07HMo0jTon7AonY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uzrUYB1oYWjIB1fiTxQOFkzv4NGJNxw9wPIgKmupzV8CauFB7qA3DQ2ZNzx7SzvGE 7yUg4MO65g8j0W1w48kjvzplH2FWp2g2b8PPXqAQ72vdg6MjONW5ZFTLo1Fa4qwgOQ YlMk26N9wRyA4LgAMCHb2SCSWhCY9KCH7e/p/+ME= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mao Wenan , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 59/60] net: set static variable an initial value in atl2_probe() Date: Wed, 13 Mar 2019 15:10:20 -0400 Message-Id: <20190313191021.158171-59-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mao Wenan [ 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(-) diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c index bb41becb6609..31ff1e0d1baa 100644 --- a/drivers/net/ethernet/atheros/atlx/atl2.c +++ b/drivers/net/ethernet/atheros/atlx/atl2.c @@ -1335,13 +1335,11 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { 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; -- 2.19.1