net: mv643xx_eth: fix orphaned statistics timer crash
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Wed, 2 Oct 2013 10:57:21 +0000 (12:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Nov 2013 12:23:40 +0000 (04:23 -0800)
commit7ee57de6eb2cb7196d502028c72a247cec591e8a
tree7a2e7c12bb173ea5a2e2b1740977f6c01b2131ff
parent75120c139e01f967659134c895f8915eff96fc66
net: mv643xx_eth: fix orphaned statistics timer crash

[ Upstream commit f564412c935111c583b787bcc18157377b208e2e ]

The periodic statistics timer gets started at port _probe() time, but
is stopped on _stop() only. In a modular environment, this can cause
the timer to access already deallocated memory, if the module is unloaded
without starting the eth device. To fix this, we add the timer right
before the port is started, instead of at _probe() time.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mv643xx_eth.c