From: "Eilon Greenstein" <eilong@broadcom.com>
To: "David Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, "Benjamin Li" <benli@broadcom.com>
Subject: [net-next 24/36] bnx2x: Check unzip return code
Date: Wed, 12 Aug 2009 21:23:48 +0300 [thread overview]
Message-ID: <1250101428.27379.176.camel@lb-tlvb-eilong> (raw)
Without this check, when running out of memory, we will see PSOD's in
bnx2x_init_fill() when doing a memset(). This is because at that time,
bp->gunzip_buf is not pointing to a valid allocated space.
Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x_main.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index cfcc4ee..656ee97 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -6511,7 +6511,9 @@ static int bnx2x_init_hw(struct bnx2x *bp, u32 load_code)
bp->dmae_ready = 0;
mutex_init(&bp->dmae_mutex);
- bnx2x_gunzip_init(bp);
+ rc = bnx2x_gunzip_init(bp);
+ if (rc)
+ return rc;
switch (load_code) {
case FW_MSG_CODE_DRV_LOAD_COMMON:
--
1.5.4.3
reply other threads:[~2009-08-12 18:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1250101428.27379.176.camel@lb-tlvb-eilong \
--to=eilong@broadcom.com \
--cc=benli@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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