diff options
author | Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> | 2014-09-14 13:32:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-15 14:17:00 -0400 |
commit | 949bdd208325a5a947135ed4f8e6df0aa18aae89 (patch) | |
tree | f355e7066573668b2d0f893f6c8718e65b00d40e /drivers/net/ethernet/freescale | |
parent | 17b6f244483a6799e43f9af649a2eb94fa1502ec (diff) |
net: ethernet: freescale: fec_main.c: Cleaning up missing null-terminate in conjunction with strncpy
Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index e242eacfc430..6e93336d1d20 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -1846,13 +1846,13 @@ static int fec_enet_mii_probe(struct net_device *ndev) | |||
1846 | continue; | 1846 | continue; |
1847 | if (dev_id--) | 1847 | if (dev_id--) |
1848 | continue; | 1848 | continue; |
1849 | strncpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE); | 1849 | strlcpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE); |
1850 | break; | 1850 | break; |
1851 | } | 1851 | } |
1852 | 1852 | ||
1853 | if (phy_id >= PHY_MAX_ADDR) { | 1853 | if (phy_id >= PHY_MAX_ADDR) { |
1854 | netdev_info(ndev, "no PHY, assuming direct connection to switch\n"); | 1854 | netdev_info(ndev, "no PHY, assuming direct connection to switch\n"); |
1855 | strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); | 1855 | strlcpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); |
1856 | phy_id = 0; | 1856 | phy_id = 0; |
1857 | } | 1857 | } |
1858 | 1858 | ||