From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751711AbbJKLvr (ORCPT ); Sun, 11 Oct 2015 07:51:47 -0400 Received: from shards.monkeyblade.net ([149.20.54.216]:57020 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbbJKLvq (ORCPT ); Sun, 11 Oct 2015 07:51:46 -0400 Date: Sun, 11 Oct 2015 05:07:01 -0700 (PDT) Message-Id: <20151011.050701.821276159987364704.davem@davemloft.net> To: wangweidong1@huawei.com Cc: sony.chacko@qlogic.com, Dept-HSGLinuxNICDev@qlogic.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, rui.xiang@huawei.com, manish.chopra@qlogic.com Subject: Re: [PATCH net-next v3] BNX2: fix a Null Pointer for stats_blk From: David Miller In-Reply-To: <56163F83.1000901@huawei.com> References: <560A02FA.6030309@huawei.com> <20150929.211011.677113057504126372.davem@davemloft.net> <56163F83.1000901@huawei.com> X-Mailer: Mew version 6.4 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 11 Oct 2015 04:51:45 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Weidong Wang Date: Thu, 8 Oct 2015 18:03:47 +0800 > we have two processes to do: > P1#: ifconfig eth0 down; which will call bnx2_close, then will > , and set Null to stats_blk > P2#: ifconfig eth0; which will call bnx2_get_stats64, it will > use stats_blk. > In one case: > --P1#-- --P2#-- > stats_blk(no null) > bnx2_free_mem > ->bp->stats_blk = NULL > GET_64BIT_NET_STATS > > then it will cause 'NULL Pointer' Problem. > it is as well with 'ethtool -S ethx'. > > Allocate the statistics block at probe time so that this problem is > impossible > > Signed-off-by: Wang Weidong Applied, thank you.