Skip to content

Commit

Permalink
net: ethernet: ti: cpmac.c: Cleaning up missing null-terminate after …
Browse files Browse the repository at this point in the history
…strncpy call

Added a guaranteed null-terminate after call to strncpy.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rickard Strandqvist authored and David S. Miller committed Aug 11, 2014
1 parent 3fadb06 commit 9951e04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/ti/cpmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9951e04

Please sign in to comment.