acpi, nfit: fix module unload vs workqueue shutdown race

The workqueue may still be running when the devres callbacks start
firing to deallocate an acpi_nfit_desc instance. Stop and flush the
workqueue before letting any other devres de-allocations proceed.

Reported-by: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Dan Williams
2017-04-18 09:56:31 -07:00
parent 8b06b884cd
commit fbabd829fe
3 changed files with 52 additions and 31 deletions

View File

@@ -1851,6 +1851,10 @@ static int nfit_test_probe(struct platform_device *pdev)
if (rc)
return rc;
rc = devm_add_action_or_reset(&pdev->dev, acpi_nfit_shutdown, acpi_desc);
if (rc)
return rc;
if (nfit_test->setup != nfit_test0_setup)
return 0;