Skip to content

Commit

Permalink
dca: check against empty dca_domains list before unregister provider
Browse files Browse the repository at this point in the history
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: <[email protected]>
Reported-by: Jiang Liu <[email protected]>
Tested-by: Gaohuai Han <[email protected]>
Signed-off-by: Maciej Sosnowski <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
Maciej Sosnowski authored and Vinod Koul committed Jan 8, 2013
1 parent 6decffd commit c419fcf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/dca/dca-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c419fcf

Please sign in to comment.