]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/block/xen-blkback/xenbus.c
Merge tag 'xfs-4.12-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[karo-tx-linux.git] / drivers / block / xen-blkback / xenbus.c
index 8fe61b5dc5a6553d141950506344fe90bbfde2c8..1f3dfaa54d871a36897408898c1e0e9f22100bb1 100644 (file)
@@ -504,11 +504,13 @@ static int xen_blkbk_remove(struct xenbus_device *dev)
 
        dev_set_drvdata(&dev->dev, NULL);
 
-       if (be->blkif)
+       if (be->blkif) {
                xen_blkif_disconnect(be->blkif);
 
-       /* Put the reference we set in xen_blkif_alloc(). */
-       xen_blkif_put(be->blkif);
+               /* Put the reference we set in xen_blkif_alloc(). */
+               xen_blkif_put(be->blkif);
+       }
+
        kfree(be->mode);
        kfree(be);
        return 0;