aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index dea7d7d1f730..a4416b09f209 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14756,8 +14756,11 @@ static void tg3_read_vpd(struct tg3 *tp)
14756 if (j + len > block_end) 14756 if (j + len > block_end)
14757 goto partno; 14757 goto partno;
14758 14758
14759 memcpy(tp->fw_ver, &vpd_data[j], len); 14759 if (len >= sizeof(tp->fw_ver))
14760 strncat(tp->fw_ver, " bc ", vpdlen - len - 1); 14760 len = sizeof(tp->fw_ver) - 1;
14761 memset(tp->fw_ver, 0, sizeof(tp->fw_ver));
14762 snprintf(tp->fw_ver, sizeof(tp->fw_ver), "%.*s bc ", len,
14763 &vpd_data[j]);
14761 } 14764 }
14762 14765
14763partno: 14766partno: