|
@@ -673,25 +673,22 @@ static void igb_get_drvinfo(struct net_device *netdev,
|
|
struct ethtool_drvinfo *drvinfo)
|
|
struct ethtool_drvinfo *drvinfo)
|
|
{
|
|
{
|
|
struct igb_adapter *adapter = netdev_priv(netdev);
|
|
struct igb_adapter *adapter = netdev_priv(netdev);
|
|
- char firmware_version[32];
|
|
|
|
u16 eeprom_data;
|
|
u16 eeprom_data;
|
|
|
|
|
|
- strncpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver) - 1);
|
|
|
|
- strncpy(drvinfo->version, igb_driver_version,
|
|
|
|
- sizeof(drvinfo->version) - 1);
|
|
|
|
|
|
+ strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver));
|
|
|
|
+ strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version));
|
|
|
|
|
|
/* EEPROM image version # is reported as firmware version # for
|
|
/* EEPROM image version # is reported as firmware version # for
|
|
* 82575 controllers */
|
|
* 82575 controllers */
|
|
adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data);
|
|
adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data);
|
|
- sprintf(firmware_version, "%d.%d-%d",
|
|
|
|
|
|
+ snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
|
|
|
|
+ "%d.%d-%d",
|
|
(eeprom_data & 0xF000) >> 12,
|
|
(eeprom_data & 0xF000) >> 12,
|
|
(eeprom_data & 0x0FF0) >> 4,
|
|
(eeprom_data & 0x0FF0) >> 4,
|
|
eeprom_data & 0x000F);
|
|
eeprom_data & 0x000F);
|
|
|
|
|
|
- strncpy(drvinfo->fw_version, firmware_version,
|
|
|
|
- sizeof(drvinfo->fw_version) - 1);
|
|
|
|
- strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
|
|
|
|
- sizeof(drvinfo->bus_info) - 1);
|
|
|
|
|
|
+ strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
|
|
|
|
+ sizeof(drvinfo->bus_info));
|
|
drvinfo->n_stats = IGB_STATS_LEN;
|
|
drvinfo->n_stats = IGB_STATS_LEN;
|
|
drvinfo->testinfo_len = IGB_TEST_LEN;
|
|
drvinfo->testinfo_len = IGB_TEST_LEN;
|
|
drvinfo->regdump_len = igb_get_regs_len(netdev);
|
|
drvinfo->regdump_len = igb_get_regs_len(netdev);
|