mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-23 22:18:17 +00:00
hv:vtd: fix MISRA-C violations on pointer not checked for null before use
This patch fix MISRA-C violations in arch/x86/vtd.c on Pointer not checked for null before use. Tracked-On: #861 Signed-off-by: Tw <wei.tan@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
725e1921e5
commit
a98a1a690c
@ -992,12 +992,16 @@ static void do_action_for_iommus(void (*action)(struct dmar_drhd_rt *))
|
||||
struct dmar_drhd_rt *dmar_unit;
|
||||
uint32_t i;
|
||||
|
||||
for (i = 0U; i < info->drhd_count; i++) {
|
||||
dmar_unit = &dmar_drhd_units[i];
|
||||
if (!dmar_unit->drhd->ignore) {
|
||||
action(dmar_unit);
|
||||
} else {
|
||||
dev_dbg(ACRN_DBG_IOMMU, "ignore dmar_unit @0x%x", dmar_unit->drhd->reg_base_addr);
|
||||
if (info == NULL) {
|
||||
pr_fatal("%s: can't find dmar info\n", __func__);
|
||||
} else {
|
||||
for (i = 0U; i < info->drhd_count; i++) {
|
||||
dmar_unit = &dmar_drhd_units[i];
|
||||
if (!dmar_unit->drhd->ignore) {
|
||||
action(dmar_unit);
|
||||
} else {
|
||||
dev_dbg(ACRN_DBG_IOMMU, "ignore dmar_unit @0x%x", dmar_unit->drhd->reg_base_addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user