Commit b0b46c77 authored by hayeswang's avatar hayeswang Committed by David S. Miller

r8152: replace strncpy with strlcpy

Replace the strncpy with strlcpy, and use sizeof to determine the
length.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5c21403d
...@@ -3151,8 +3151,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev, ...@@ -3151,8 +3151,8 @@ static void rtl8152_get_drvinfo(struct net_device *netdev,
{ {
struct r8152 *tp = netdev_priv(netdev); struct r8152 *tp = netdev_priv(netdev);
strncpy(info->driver, MODULENAME, ETHTOOL_BUSINFO_LEN); strlcpy(info->driver, MODULENAME, sizeof(info->driver));
strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN); strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info)); usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment