Skip to content

Commit

Permalink
Staging: hv: storvsc: Fix a bug in the storvsc_remove() function
Browse files Browse the repository at this point in the history
When the storvs driver unloads, we need to accomodate disk cache flushes.
Re-order the code to permit this.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Jun 7, 2011
1 parent d9bbae8 commit 2935a40
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,22 +317,20 @@ static int storvsc_remove(struct hv_device *dev)
struct hv_host_device *host_dev =
(struct hv_host_device *)host->hostdata;

DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host);
scsi_remove_host(host);

DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host);
scsi_host_put(host);
/*
* Call to the vsc driver to let it know that the device is being
* removed
*/
storvsc_dev_remove(dev);

if (host_dev->request_pool) {
kmem_cache_destroy(host_dev->request_pool);
host_dev->request_pool = NULL;
}

DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host);
scsi_remove_host(host);

DPRINT_INFO(STORVSC, "releasing host adapter (%p)...", host);
scsi_host_put(host);
return 0;
}

Expand Down

0 comments on commit 2935a40

Please sign in to comment.