diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-01-05 19:44:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-07 00:06:31 -0500 |
commit | 7826d43f2db45c9305a6e0ba165650e1a203f517 (patch) | |
tree | a8659c995a37f58db809da9537aafac178431f31 /arch/um/drivers | |
parent | 2afb9b533423a9b97f84181e773cf9361d98fed6 (diff) |
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 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/net_kern.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index fd9090df64b6..d8926c303629 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -274,8 +274,8 @@ static void uml_net_poll_controller(struct net_device *dev) | |||
274 | static void uml_net_get_drvinfo(struct net_device *dev, | 274 | static void uml_net_get_drvinfo(struct net_device *dev, |
275 | struct ethtool_drvinfo *info) | 275 | struct ethtool_drvinfo *info) |
276 | { | 276 | { |
277 | strcpy(info->driver, DRIVER_NAME); | 277 | strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver)); |
278 | strcpy(info->version, "42"); | 278 | strlcpy(info->version, "42", sizeof(info->version)); |
279 | } | 279 | } |
280 | 280 | ||
281 | static const struct ethtool_ops uml_net_ethtool_ops = { | 281 | static const struct ethtool_ops uml_net_ethtool_ops = { |