Skip to content

Commit

Permalink
intel_sst: fix unload bugs
Browse files Browse the repository at this point in the history
The current driver remove was erroneous and causes
errors when unloading or loading second time

This patch fixes both of these issues

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vinod Koul authored and Greg Kroah-Hartman committed May 10, 2011
1 parent b06a584 commit 1bea302
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/staging/intel_sst/intel_sst.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ static int __devinit intel_sst_probe(struct pci_dev *pci,
destroy_workqueue(sst_drv_ctx->mad_wq);
do_free_drv_ctx:
kfree(sst_drv_ctx);
pr_err("Probe failed with 0x%x\n", ret);
sst_drv_ctx = NULL;
pr_err("Probe failed with %d\n", ret);
return ret;
}

Expand Down Expand Up @@ -407,11 +408,9 @@ static void __devexit intel_sst_remove(struct pci_dev *pci)
destroy_workqueue(sst_drv_ctx->post_msg_wq);
destroy_workqueue(sst_drv_ctx->mad_wq);
kfree(sst_drv_ctx);
pci_release_region(pci, 1);
pci_release_region(pci, 2);
pci_release_region(pci, 3);
pci_release_region(pci, 4);
pci_release_region(pci, 5);
sst_drv_ctx = NULL;
pci_release_regions(pci);
pci_disable_device(pci);
pci_set_drvdata(pci, NULL);
}

Expand Down Expand Up @@ -604,6 +603,7 @@ static void __exit intel_sst_exit(void)
pci_unregister_driver(&driver);

pr_debug("driver unloaded\n");
sst_drv_ctx = NULL;
return;
}

Expand Down

0 comments on commit 1bea302

Please sign in to comment.