ethtool: fix drvinfo strings set in drivers
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / net / ethernet / ti / cpmac.c
index d9625f62b026cd06bbfdff222af8950b90bd3027..70d1920cac9799b279564cd59a336d9210688d77 100644 (file)
@@ -904,10 +904,9 @@ static int cpmac_set_ringparam(struct net_device *dev,
 static void cpmac_get_drvinfo(struct net_device *dev,
                              struct ethtool_drvinfo *info)
 {
-       strcpy(info->driver, "cpmac");
-       strcpy(info->version, CPMAC_VERSION);
-       info->fw_version[0] = '\0';
-       sprintf(info->bus_info, "%s", "cpmac");
+       strlcpy(info->driver, "cpmac", sizeof(info->driver));
+       strlcpy(info->version, CPMAC_VERSION, sizeof(info->version));
+       snprintf(info->bus_info, sizeof(info->bus_info), "%s", "cpmac");
        info->regdump_len = 0;
 }