Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72920
b: refs/heads/master
c: 6279344
h: refs/heads/master
v: v3
  • Loading branch information
Michael Albaugh authored and Roland Dreier committed Oct 30, 2007
1 parent 5b366a7 commit be27722
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fffbfeaa680e2b87a591e141f2aa7e9e91184956
refs/heads/master: 627934448ec80f823eafd0a7d4b7541515d543a3
10 changes: 9 additions & 1 deletion trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,15 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust)
u8 *ip = (u8 *) ifp;
u8 csum = 0, len;

for (len = 0; len < ifp->if_length; len++)
/*
* Limit length checksummed to max length of actual data.
* Checksum of erased eeprom will still be bad, but we avoid
* reading past the end of the buffer we were passed.
*/
len = ifp->if_length;
if (len > sizeof(struct ipath_flash))
len = sizeof(struct ipath_flash);
while (len--)
csum += *ip++;
csum -= ifp->if_csum;
csum = ~csum;
Expand Down

0 comments on commit be27722

Please sign in to comment.