mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
2afb9b5334
commit
7826d43f2d
86 changed files with 297 additions and 277 deletions
|
|
@ -203,10 +203,10 @@ dsa_slave_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
static void dsa_slave_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *drvinfo)
|
||||
{
|
||||
strncpy(drvinfo->driver, "dsa", 32);
|
||||
strncpy(drvinfo->version, dsa_driver_version, 32);
|
||||
strncpy(drvinfo->fw_version, "N/A", 32);
|
||||
strncpy(drvinfo->bus_info, "platform", 32);
|
||||
strlcpy(drvinfo->driver, "dsa", sizeof(drvinfo->driver));
|
||||
strlcpy(drvinfo->version, dsa_driver_version, sizeof(drvinfo->version));
|
||||
strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
|
||||
strlcpy(drvinfo->bus_info, "platform", sizeof(drvinfo->bus_info));
|
||||
}
|
||||
|
||||
static int dsa_slave_nway_reset(struct net_device *dev)
|
||||
|
|
|
|||
Loading…
Reference in a new issue