[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1410715962-15986-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Date: Sun, 14 Sep 2014 19:32:42 +0200
From: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To: Grant Likely <grant.likely@...aro.org>,
Rob Herring <robh+dt@...nel.org>
Cc: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
"David S. Miller" <davem@...emloft.net>,
Nimrod Andy <B38611@...escale.com>,
Russell King <rmk+kernel@....linux.org.uk>,
Fabio Estevam <fabio.estevam@...escale.com>,
Frank Li <frank.li@...escale.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: [PATCH] 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@...ctrumdigital.se>
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 89355a7..e84b132 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1674,13 +1674,13 @@ static int fec_enet_mii_probe(struct net_device *ndev)
continue;
if (dev_id--)
continue;
- strncpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE);
+ strlcpy(mdio_bus_id, fep->mii_bus->id, MII_BUS_ID_SIZE);
break;
}
if (phy_id >= PHY_MAX_ADDR) {
netdev_info(ndev, "no PHY, assuming direct connection to switch\n");
- strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
+ strlcpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
phy_id = 0;
}
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists