team: use strlcpy with ethtool_drvinfo fields
The fields must be null-terminated. Signed-off-by: Flavio Leitner <fbl@redhat.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5d134f1c1f
commit
3066af582f
@ -1747,8 +1747,8 @@ static const struct net_device_ops team_netdev_ops = {
|
||||
static void team_ethtool_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *drvinfo)
|
||||
{
|
||||
strncpy(drvinfo->driver, DRV_NAME, 32);
|
||||
strncpy(drvinfo->version, UTS_RELEASE, 32);
|
||||
strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
|
||||
strlcpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops team_ethtool_ops = {
|
||||
|
Loading…
Reference in New Issue
Block a user