From: K. Y. Srinivasan Date: Mon, 6 Jun 2011 22:49:28 +0000 (-0700) Subject: Staging: hv: storvsc: Fix a bug in the storvsc_remove() function X-Git-Tag: next-20110726~5^2~568^2~78 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2935a407e2173886457816e34c29b130f11198e5;p=karo-tx-linux.git Staging: hv: storvsc: Fix a bug in the storvsc_remove() function 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 Signed-off-by: Haiyang Zhang Signed-off-by: Abhishek Kane Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index 33bce87793be..fd474d6d3583 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -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; }