mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -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
|
|
@ -15,10 +15,10 @@ static void cfg80211_get_drvinfo(struct net_device *dev,
|
|||
strlcpy(info->version, init_utsname()->release, sizeof(info->version));
|
||||
|
||||
if (wdev->wiphy->fw_version[0])
|
||||
strncpy(info->fw_version, wdev->wiphy->fw_version,
|
||||
strlcpy(info->fw_version, wdev->wiphy->fw_version,
|
||||
sizeof(info->fw_version));
|
||||
else
|
||||
strncpy(info->fw_version, "N/A", sizeof(info->fw_version));
|
||||
strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
|
||||
|
||||
strlcpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
|
||||
sizeof(info->bus_info));
|
||||
|
|
|
|||
Loading…
Reference in a new issue