virtio_net: Fix panic in virtnet_remove
authorKrishna Kumar <krkumar2@in.ibm.com>
Wed, 20 Jul 2011 03:56:02 +0000 (03:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Jul 2011 04:29:34 +0000 (21:29 -0700)
commit2e66f55b3afa290337a47e6ea134ac071c5dd9a7
tree8955f5e6c3502174768de8c51d480a0abbf51a40
parent87c48fa3b4630905f98268dde838ee43626a060c
virtio_net: Fix panic in virtnet_remove

Fix a panic in virtnet_remove. unregister_netdev has already
freed up the netdev (and virtnet_info) due to dev->destructor
being set, while virtnet_info is still required. Remove
virtnet_free altogether, and move the freeing of the per-cpu
statistics from virtnet_free to virtnet_remove.

Tested patch below.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c