Skip to content

Commit

Permalink
dmar: fix dmar_parse_dev() devices_cnt error condition check
Browse files Browse the repository at this point in the history
It is possible that,
instead of PCI endpoint/sub-hierarchy structures, only IO-APIC/HPET
devices may be reported under device scope structures. Fix the devices_cnt
error check, which cares about only PCI structures and removes the
dma-remapping unit structure (dmaru) when the devices_cnt is zero
and include_all flag is not set.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Suresh Siddha authored and Ingo Molnar committed Oct 16, 2008
1 parent 04e2ea6 commit 1c7d1bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ dmar_parse_dev(struct dmar_drhd_unit *dmaru)
include_all = 1;
}

if (ret || (dmaru->devices_cnt == 0 && !dmaru->include_all)) {
if (ret) {
list_del(&dmaru->list);
kfree(dmaru);
}
Expand Down

0 comments on commit 1c7d1bc

Please sign in to comment.