From: Rickard Strandqvist Date: Sat, 9 Aug 2014 23:41:47 +0000 (+0200) Subject: net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call X-Git-Tag: v3.17-rc1~33^2~9 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=9951e0484972c9918f8a38ff047cfbad388058d4;p=~emulex%2Finfiniband.git net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after strncpy call Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c index 3809f4ec282..f9bcf7aa88c 100644 --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c @@ -1130,6 +1130,7 @@ static int cpmac_probe(struct platform_device *pdev) strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */ phy_id = pdev->id; } + mdio_bus_id[sizeof(mdio_bus_id) - 1] = '\0'; dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); if (!dev)