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, manish.chopra@qlogic•com
Subject: Re: [PATCH net-next v2 RESEND] BNX2: fix a Null Pointer for stats_blk
Date: Tue, 29 Sep 2015 21:10:11 -0700 (PDT) [thread overview]
Message-ID: <20150929.211011.677113057504126372.davem@davemloft.net> (raw)
In-Reply-To: <560A02FA.6030309@huawei.com>
From: Weidong Wang <wangweidong1@huawei•com>
Date: Tue, 29 Sep 2015 11:18:18 +0800
> @@ -839,11 +828,12 @@ bnx2_free_mem(struct bnx2 *bp)
> }
>
> static int
> -bnx2_alloc_mem(struct bnx2 *bp)
> +bnx2_alloc_stats_blk(struct net_device *dev)
> {
> - int i, status_blk_size, err;
> + int i, status_blk_size;
> struct bnx2_napi *bnapi;
> void *status_blk;
> + struct bnx2 *bp = netdev_priv(dev);
>
> /* Combine status and statistics blocks into one allocation. */
> status_blk_size = L1_CACHE_ALIGN(sizeof(struct status_block));
This function is not just allocating the stats block, it's allocating
a whole bunch of other things too.
Only allocate the stats block at probe time, not the NAPI et al. stuff
as well. That can safely stay in the open/close paths.
next prev parent reply other threads:[~2015-09-30 4:10 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
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 [this message]
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=20150929.211011.677113057504126372.davem@davemloft.net \
--to=davem@davemloft$(echo .)net \
--cc=Dept-HSGLinuxNICDev@qlogic$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=manish.chopra@qlogic$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rui.xiang@huawei$(echo .)com \
--cc=sony.chacko@qlogic$(echo .)com \
--cc=wangweidong1@huawei$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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