Skip to content

Commit c0fcded

Browse files
Paul Durrantdavem330
authored andcommitted
xen-netback: only deinitialized hash if it was initialized
A domain with a frontend that does not implement a control ring has been seen to cause a crash during domain save. This was apparently because the call to xenvif_deinit_hash() in xenvif_disconnect_ctrl() is made regardless of whether a control ring was connected, and hence xenvif_hash_init() was called. This patch brings the call to xenvif_deinit_hash() in xenvif_disconnect_ctrl() inside the if clause that checks whether the control ring event channel was connected. This is sufficient to ensure it is only called if xenvif_init_hash() was called previously. Signed-off-by: Paul Durrant <[email protected]> Reported-by: Boris Ostrovsky <[email protected]> Tested-by: Boris Ostrovsky <[email protected]> Cc: Wei Liu <[email protected]> Acked-by: Wei Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e6790fd commit c0fcded

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/xen-netback/interface.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,8 @@ void xenvif_disconnect_ctrl(struct xenvif *vif)
780780
vif->ctrl_task = NULL;
781781
}
782782

783-
xenvif_deinit_hash(vif);
784-
785783
if (vif->ctrl_irq) {
784+
xenvif_deinit_hash(vif);
786785
unbind_from_irqhandler(vif->ctrl_irq, vif);
787786
vif->ctrl_irq = 0;
788787
}

0 commit comments

Comments
 (0)