Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213807
b: refs/heads/master
c: 7c46835
h: refs/heads/master
i:
  213805: 913a3b2
  213803: ec0da4e
  213799: e7b9cf1
  213791: f4b46c9
v: v3
  • Loading branch information
Roopa Prabhu authored and David S. Miller committed Aug 17, 2010
1 parent cd324e5 commit f8d88d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: ae94abe1687871d9772494b3d378c6d3decd7f75
refs/heads/master: 7c46835e4845fed5f348f5845a3a6165874e2f05
7 changes: 4 additions & 3 deletions trunk/drivers/net/enic/vnic_vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
if (!vp || !value)
return -EINVAL;

if (ntohl(vp->length) + sizeof(*tlv) + length >
VIC_PROVINFO_MAX_TLV_DATA)
if (ntohl(vp->length) + offsetof(struct vic_provinfo_tlv, value) +
length > VIC_PROVINFO_MAX_TLV_DATA)
return -ENOMEM;

tlv = (struct vic_provinfo_tlv *)((u8 *)vp->tlv +
Expand All @@ -66,7 +66,8 @@ int vic_provinfo_add_tlv(struct vic_provinfo *vp, u16 type, u16 length,
memcpy(tlv->value, value, length);

vp->num_tlvs = htonl(ntohl(vp->num_tlvs) + 1);
vp->length = htonl(ntohl(vp->length) + sizeof(*tlv) + length);
vp->length = htonl(ntohl(vp->length) +
offsetof(struct vic_provinfo_tlv, value) + length);

return 0;
}
Expand Down

0 comments on commit f8d88d4

Please sign in to comment.