Commit c419fcfd authored by Maciej Sosnowski's avatar Maciej Sosnowski Committed by Vinod Koul

dca: check against empty dca_domains list before unregister provider

When providers get blocked unregister_dca_providers() is called ending up
with dca_providers and dca_domain lists emptied. Dca should be prevented from
trying to unregister any provider if dca_domain list is found empty.

Cc: <stable@vger.kernel.org>
Reported-by: default avatarJiang Liu <jiang.liu@huawei.com>
Tested-by: default avatarGaohuai Han <hangaohuai@huawei.com>
Signed-off-by: default avatarMaciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: default avatarDan Williams <djbw@fb.com>
parent 6decffd5
......@@ -420,6 +420,11 @@ void unregister_dca_provider(struct dca_provider *dca, struct device *dev)
raw_spin_lock_irqsave(&dca_lock, flags);
if (list_empty(&dca_domains)) {
raw_spin_unlock_irqrestore(&dca_lock, flags);
return;
}
list_del(&dca->node);
pci_rc = dca_pci_rc_from_dev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment