Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214530
b: refs/heads/master
c: a4a8bb1
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Sep 15, 2010
1 parent e253fee commit 1418e45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 02e96080af2b70313f2ffc8c1b03ae2f9d8c65ac
refs/heads/master: a4a8bb15aed20ff74aa3ca14a4f2c0d62efd8391
15 changes: 11 additions & 4 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -12415,14 +12415,18 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)

static void __devinit tg3_read_vpd(struct tg3 *tp)
{
u8 vpd_data[TG3_NVM_VPD_LEN];
u8 *vpd_data;
unsigned int block_end, rosize, len;
int j, i = 0;
u32 magic;

if ((tp->tg3_flags3 & TG3_FLG3_NO_NVRAM) ||
tg3_nvram_read(tp, 0x0, &magic))
goto out_not_found;
goto out_no_vpd;

vpd_data = kmalloc(TG3_NVM_VPD_LEN, GFP_KERNEL);
if (!vpd_data)
goto out_no_vpd;

if (magic == TG3_EEPROM_MAGIC) {
for (i = 0; i < TG3_NVM_VPD_LEN; i += 4) {
Expand Down Expand Up @@ -12506,9 +12510,12 @@ static void __devinit tg3_read_vpd(struct tg3 *tp)

memcpy(tp->board_part_number, &vpd_data[i], len);

return;

out_not_found:
kfree(vpd_data);
if (!tp->board_part_number[0])
return;

out_no_vpd:
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
strcpy(tp->board_part_number, "BCM95906");
else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 &&
Expand Down

0 comments on commit 1418e45

Please sign in to comment.