From: "Michael Chan" <mchan@broadcom.com>
To: davem@davemloft.net, agospoda@redhat.com, netdev@vger.kernel.org
Subject: [PATCH 2/3][BNX2]: Fix bug in bnx2_nvram_write().
Date: Wed, 13 Dec 2006 18:30:39 -0800 [thread overview]
Message-ID: <1166063439.30522.6.camel@rh4> (raw)
[BNX2]: Fix bug in bnx2_nvram_write().
Length was not calculated correctly if the NVRAM offset is on a non-
aligned offset.
Signed-off-by: Michael Chan <mchan@broadcom.com>
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f296c37..4fa7cef 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3096,7 +3096,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 of
if ((align_start = (offset32 & 3))) {
offset32 &= ~3;
- len32 += align_start;
+ len32 += (4 - align_start);
if ((rc = bnx2_nvram_read(bp, offset32, start, 4)))
return rc;
}
@@ -3114,7 +3114,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 of
if (align_start || align_end) {
buf = kmalloc(len32, GFP_KERNEL);
- if (buf == 0)
+ if (buf == NULL)
return -ENOMEM;
if (align_start) {
memcpy(buf, start, 4);
next reply other threads:[~2006-12-14 1:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 2:30 Michael Chan [this message]
2006-12-14 23:57 ` [PATCH 2/3][BNX2]: Fix bug in bnx2_nvram_write() 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=1166063439.30522.6.camel@rh4 \
--to=mchan@broadcom.com \
--cc=agospoda@redhat.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;
as well as URLs for NNTP newsgroup(s).