Skip to content

Commit

Permalink
xen-netback: keep a local pointer for vif in backend_disconnect()
Browse files Browse the repository at this point in the history
This patch replaces use of 'be->vif' with 'vif' and hence generally
makes the function look tidier. No semantic change.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Durrant authored and davem330 committed Mar 3, 2017
1 parent f7bb3d8 commit d67ce7d
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions drivers/net/xen-netback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,24 +492,28 @@ static int backend_create_xenvif(struct backend_info *be)

static void backend_disconnect(struct backend_info *be)
{
if (be->vif) {
struct xenvif *vif = be->vif;

if (vif) {
unsigned int queue_index;

xen_unregister_watchers(be->vif);
xen_unregister_watchers(vif);
#ifdef CONFIG_DEBUG_FS
xenvif_debugfs_delif(be->vif);
xenvif_debugfs_delif(vif);
#endif /* CONFIG_DEBUG_FS */
xenvif_disconnect_data(be->vif);
for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index)
xenvif_deinit_queue(&be->vif->queues[queue_index]);

spin_lock(&be->vif->lock);
vfree(be->vif->queues);
be->vif->num_queues = 0;
be->vif->queues = NULL;
spin_unlock(&be->vif->lock);

xenvif_disconnect_ctrl(be->vif);
xenvif_disconnect_data(vif);
for (queue_index = 0;
queue_index < vif->num_queues;
++queue_index)
xenvif_deinit_queue(&vif->queues[queue_index]);

spin_lock(&vif->lock);
vfree(vif->queues);
vif->num_queues = 0;
vif->queues = NULL;
spin_unlock(&vif->lock);

xenvif_disconnect_ctrl(vif);
}
}

Expand Down

0 comments on commit d67ce7d

Please sign in to comment.