From: David Miller <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
Subject: Re: [PATCH net-next] BNX2: fix a Null Pointer for stats_blk
Date: Wed, 23 Sep 2015 15:31:17 -0700 (PDT) [thread overview]
Message-ID: <20150923.153117.2291008783799112683.davem@davemloft.net> (raw)
In-Reply-To: <56014CC0.3050201@huawei.com>
From: Weidong Wang <wangweidong1@huawei.com>
Date: Tue, 22 Sep 2015 20:42:40 +0800
> @@ -880,6 +882,7 @@ bnx2_alloc_mem(struct bnx2 *bp)
> }
> }
>
> + spin_lock(&bp->stats64_lock);
> bp->stats_blk = status_blk + status_blk_size;
>
> bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;
> @@ -894,20 +897,23 @@ bnx2_alloc_mem(struct bnx2 *bp)
> &bp->ctx_blk_mapping[i],
> GFP_KERNEL);
> if (bp->ctx_blk[i] == NULL)
> - goto alloc_mem_err;
> + goto free_stats64_lock;
> }
> }
>
> err = bnx2_alloc_rx_mem(bp);
> if (err)
> - goto alloc_mem_err;
> + goto free_stats64_lock;
You're holding a spinlock while doing GFP_KERNEL allocations.
Second of all, taking a spinlock in get_stats64() defeats the whole
intention of making statistics acquisition as fast and as SMP scalable
as possible.
next prev parent reply other threads:[~2015-09-23 22:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 12:42 [PATCH net-next] BNX2: fix a Null Pointer for stats_blk Weidong Wang
2015-09-23 22:31 ` David Miller [this message]
2015-09-24 2:00 ` Weidong Wang
2015-09-24 5:34 ` David Miller
2015-09-24 6:53 ` Weidong Wang
2015-09-28 7:01 ` [PATCH net-next v2] " Weidong Wang
2015-09-29 3:15 ` Weidong Wang
2015-09-29 3:18 ` [PATCH net-next v2 RESEND] " Weidong Wang
2015-09-30 4:10 ` David Miller
2015-10-08 10:03 ` [PATCH net-next v3] " Weidong Wang
2015-10-11 12:07 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150923.153117.2291008783799112683.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Dept-HSGLinuxNICDev@qlogic.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rui.xiang@huawei.com \
--cc=sony.chacko@qlogic.com \
--cc=wangweidong1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).