ethtool: Null-terminate filename passed to ethtool_ops::flash_device
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 1 Feb 2012 09:32:25 +0000 (09:32 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:44:03 +0000 (00:44 +0100)
commit077ae2b73b4c110e9d458b071a61c9f2b33ee58e
treec9ee85318270d34886aad7993b39d972dc77ecf2
parentd655fe1e7e79ee5012d83bf66a9e524aa55ec7de
ethtool: Null-terminate filename passed to ethtool_ops::flash_device

commit 786f528119722f564a22ad953411374e06116333 upstream.

The parameters for ETHTOOL_FLASHDEV include a filename, which ought to
be null-terminated.  Currently the only driver that implements
ethtool_ops::flash_device attempts to add a null terminator if
necessary, but does it wrongly.  Do it in the ethtool core instead.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/emulex/benet/be_ethtool.c
net/core/ethtool.c