summaryrefslogtreecommitdiff
path: root/net/batman-adv
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-06 00:44:26 (GMT)
committerEmil Medve <Emilian.Medve@Freescale.com>2013-03-21 07:02:37 (GMT)
commitc01e0e4a6ecc3bcda21c3073e78237b95dacf3bc (patch)
tree19f0b3fcbca9042790ef65492b29eaec7ea590f3 /net/batman-adv
parent10824b419e25a715b7b6787dab5a46b3035dfaf5 (diff)
downloadlinux-fsl-qoriq-c01e0e4a6ecc3bcda21c3073e78237b95dacf3bc.tar.xz
ethtool: fix drvinfo strings set in drivers
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/soft-interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 6b548fd..8387c12 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -581,10 +581,10 @@ static int batadv_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static void batadv_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
- strcpy(info->driver, "B.A.T.M.A.N. advanced");
- strcpy(info->version, BATADV_SOURCE_VERSION);
- strcpy(info->fw_version, "N/A");
- strcpy(info->bus_info, "batman");
+ strlcpy(info->driver, "B.A.T.M.A.N. advanced", sizeof(info->driver));
+ strlcpy(info->version, BATADV_SOURCE_VERSION, sizeof(info->version));
+ strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
+ strlcpy(info->bus_info, "batman", sizeof(info->bus_info));
}
static u32 batadv_get_msglevel(struct net_device *dev)