Skip to content

Commit d67ce7d

Browse files
Paul Durrantdavem330
authored andcommitted
xen-netback: keep a local pointer for vif in backend_disconnect()
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f7bb3d8 commit d67ce7d

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

drivers/net/xen-netback/xenbus.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -492,24 +492,28 @@ static int backend_create_xenvif(struct backend_info *be)
492492

493493
static void backend_disconnect(struct backend_info *be)
494494
{
495-
if (be->vif) {
495+
struct xenvif *vif = be->vif;
496+
497+
if (vif) {
496498
unsigned int queue_index;
497499

498-
xen_unregister_watchers(be->vif);
500+
xen_unregister_watchers(vif);
499501
#ifdef CONFIG_DEBUG_FS
500-
xenvif_debugfs_delif(be->vif);
502+
xenvif_debugfs_delif(vif);
501503
#endif /* CONFIG_DEBUG_FS */
502-
xenvif_disconnect_data(be->vif);
503-
for (queue_index = 0; queue_index < be->vif->num_queues; ++queue_index)
504-
xenvif_deinit_queue(&be->vif->queues[queue_index]);
505-
506-
spin_lock(&be->vif->lock);
507-
vfree(be->vif->queues);
508-
be->vif->num_queues = 0;
509-
be->vif->queues = NULL;
510-
spin_unlock(&be->vif->lock);
511-
512-
xenvif_disconnect_ctrl(be->vif);
504+
xenvif_disconnect_data(vif);
505+
for (queue_index = 0;
506+
queue_index < vif->num_queues;
507+
++queue_index)
508+
xenvif_deinit_queue(&vif->queues[queue_index]);
509+
510+
spin_lock(&vif->lock);
511+
vfree(vif->queues);
512+
vif->num_queues = 0;
513+
vif->queues = NULL;
514+
spin_unlock(&vif->lock);
515+
516+
xenvif_disconnect_ctrl(vif);
513517
}
514518
}
515519

0 commit comments

Comments
 (0)