aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/3com/typhoon.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/3com/typhoon.c')
-rw-r--r--drivers/net/ethernet/3com/typhoon.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 20ea07508ac7..6d6bc754b1a8 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -988,21 +988,23 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
988 988
989 smp_rmb(); 989 smp_rmb();
990 if(tp->card_state == Sleeping) { 990 if(tp->card_state == Sleeping) {
991 strcpy(info->fw_version, "Sleep image"); 991 strlcpy(info->fw_version, "Sleep image",
992 sizeof(info->fw_version));
992 } else { 993 } else {
993 INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS); 994 INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
994 if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) { 995 if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
995 strcpy(info->fw_version, "Unknown runtime"); 996 strlcpy(info->fw_version, "Unknown runtime",
997 sizeof(info->fw_version));
996 } else { 998 } else {
997 u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2); 999 u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2);
998 snprintf(info->fw_version, 32, "%02x.%03x.%03x", 1000 snprintf(info->fw_version, sizeof(info->fw_version),
999 sleep_ver >> 24, (sleep_ver >> 12) & 0xfff, 1001 "%02x.%03x.%03x", sleep_ver >> 24,
1000 sleep_ver & 0xfff); 1002 (sleep_ver >> 12) & 0xfff, sleep_ver & 0xfff);
1001 } 1003 }
1002 } 1004 }
1003 1005
1004 strcpy(info->driver, KBUILD_MODNAME); 1006 strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
1005 strcpy(info->bus_info, pci_name(pci_dev)); 1007 strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
1006} 1008}
1007 1009
1008static int 1010static int