xen-netback: clear vif->task on disconnect
authorPaul Durrant <Paul.Durrant@citrix.com>
Tue, 3 Dec 2013 14:06:25 +0000 (14:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Dec 2013 16:49:30 +0000 (11:49 -0500)
commit67fa36609fe0a0a4b4c99120e5093599556e4c5b
tree4c607aeaa3de8da2b7b3de8d2457195c643281cb
parent7ce5a27f2ef8ed4f8f892f46391f933c0e2ac0f1
xen-netback: clear vif->task on disconnect

xenvif_start_xmit() relies on checking vif->task for NULL to determine
whether the vif is ready to accept packets. The task thread is stopped in
xenvif_disconnect() but task is not set to NULL. Thus, on a re-connect the
check will give a false positive.

Also since commit ea732dff5cfa10789007bf4a5b935388a0bb2a8f (Handle backend
state transitions in a more robust way) it should not be possible for
xenvif_connect() to be called if the vif is already connected so change the
check of vif->tx_irq to a BUG_ON() and also add a BUG_ON(vif->task).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/xen-netback/interface.c