aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000e/ethtool.c14
-rw-r--r--drivers/net/e1000e/netdev.c4
2 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index affcacf6f5a9..c942ccab8bca 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -624,20 +624,24 @@ static void e1000_get_drvinfo(struct net_device *netdev,
624 struct e1000_adapter *adapter = netdev_priv(netdev); 624 struct e1000_adapter *adapter = netdev_priv(netdev);
625 char firmware_version[32]; 625 char firmware_version[32];
626 626
627 strncpy(drvinfo->driver, e1000e_driver_name, 32); 627 strncpy(drvinfo->driver, e1000e_driver_name,
628 strncpy(drvinfo->version, e1000e_driver_version, 32); 628 sizeof(drvinfo->driver) - 1);
629 strncpy(drvinfo->version, e1000e_driver_version,
630 sizeof(drvinfo->version) - 1);
629 631
630 /* 632 /*
631 * EEPROM image version # is reported as firmware version # for 633 * EEPROM image version # is reported as firmware version # for
632 * PCI-E controllers 634 * PCI-E controllers
633 */ 635 */
634 sprintf(firmware_version, "%d.%d-%d", 636 snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d",
635 (adapter->eeprom_vers & 0xF000) >> 12, 637 (adapter->eeprom_vers & 0xF000) >> 12,
636 (adapter->eeprom_vers & 0x0FF0) >> 4, 638 (adapter->eeprom_vers & 0x0FF0) >> 4,
637 (adapter->eeprom_vers & 0x000F)); 639 (adapter->eeprom_vers & 0x000F));
638 640
639 strncpy(drvinfo->fw_version, firmware_version, 32); 641 strncpy(drvinfo->fw_version, firmware_version,
640 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); 642 sizeof(drvinfo->fw_version) - 1);
643 strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
644 sizeof(drvinfo->bus_info) - 1);
641 drvinfo->regdump_len = e1000_get_regs_len(netdev); 645 drvinfo->regdump_len = e1000_get_regs_len(netdev);
642 drvinfo->eedump_len = e1000_get_eeprom_len(netdev); 646 drvinfo->eedump_len = e1000_get_eeprom_len(netdev);
643} 647}
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 5498689ac20c..98729a6fb096 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5639,7 +5639,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
5639 ret_val = e1000_read_pba_string_generic(hw, pba_str, 5639 ret_val = e1000_read_pba_string_generic(hw, pba_str,
5640 E1000_PBANUM_LENGTH); 5640 E1000_PBANUM_LENGTH);
5641 if (ret_val) 5641 if (ret_val)
5642 strcpy(pba_str, "Unknown"); 5642 strncpy((char *)pba_str, "Unknown", sizeof(pba_str) - 1);
5643 e_info("MAC: %d, PHY: %d, PBA No: %s\n", 5643 e_info("MAC: %d, PHY: %d, PBA No: %s\n",
5644 hw->mac.type, hw->phy.type, pba_str); 5644 hw->mac.type, hw->phy.type, pba_str);
5645} 5645}
@@ -5968,7 +5968,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
5968 if (!(adapter->flags & FLAG_HAS_AMT)) 5968 if (!(adapter->flags & FLAG_HAS_AMT))
5969 e1000_get_hw_control(adapter); 5969 e1000_get_hw_control(adapter);
5970 5970
5971 strcpy(netdev->name, "eth%d"); 5971 strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1);
5972 err = register_netdev(netdev); 5972 err = register_netdev(netdev);
5973 if (err) 5973 if (err)
5974 goto err_register; 5974 goto err_register;