[patch 5/5] dmar: fix dmar_parse_dev() devices_cnt error condition check

From: Suresh Siddha
Date: Wed Sep 03 2008 - 20:09:26 EST


From: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Subject: dmar: fix dmar_parse_dev() devices_cnt error condition check

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@xxxxxxxxx>
Acked-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>
---

Index: tip/drivers/pci/dmar.c
===================================================================
--- tip.orig/drivers/pci/dmar.c 2008-09-03 13:57:28.000000000 -0700
+++ tip/drivers/pci/dmar.c 2008-09-03 13:59:12.000000000 -0700
@@ -212,7 +212,7 @@
include_all = 1;
}

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

--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/