Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a13add1e1b802a29187a9af98a6ca26539dc33d
Commit:     6a13add1e1b802a29187a9af98a6ca26539dc33d
Parent:     faac9c4b753f420c02bdce0785d2657087830a12
Author:     Michael Chan <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 14 15:56:50 2006 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sun Dec 17 21:59:16 2006 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/bnx2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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 offset, u8 
*data_buf,
 
        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 offset, u8 
*data_buf,
 
        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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to