dm: Coding style fix: Handle failure of parsing /proc/iomem

In get_mmio_hpa_resource, although very unlikely, parsing
of /proc/iomem may fail. Handle the case of failure and exit early.

Tracked-On: #7593
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
Yifan Liu 2022-06-14 06:18:07 +00:00 committed by acrnsi-robot
parent b5d3f93e56
commit 6bbbddd974

View File

@ -137,6 +137,9 @@ int get_mmio_hpa_resource(char *name, uint64_t *res_start, uint64_t *res_size)
pr_err("Please run acrn-dm with superuser privilege\n");
break;
}
} else {
pr_err("Parsing /proc/iomem failed\n");
break;
}
*res_start = start;