diff mbox

[35/52] xen/drivers/passthrough/vtd/dmar.c: let custom parameter parsing routines return errno

Message ID 20170809070706.13481-36-jgross@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jürgen Groß Aug. 9, 2017, 7:06 a.m. UTC
Modify the custom parameter parsing routines in:

xen/drivers/passthrough/vtd/dmar.c

to indicate whether the parameter value was parsed successfully.

Cc: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/drivers/passthrough/vtd/dmar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 82040ddc05..dd122da730 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -1090,7 +1090,7 @@  int intel_iommu_get_reserved_device_memory(iommu_grdm_t *func, void *ctxt)
  * If a segment is specified for other than the first device, and it does not
  * match the one specified for the first one, an error will be reported.
  */
-static void __init parse_rmrr_param(const char *str)
+static int __init parse_rmrr_param(const char *str)
 {
     const char *s = str, *cur, *stmp;
     unsigned int seg, bus, dev, func, dev_count;
@@ -1143,5 +1143,7 @@  static void __init parse_rmrr_param(const char *str)
             nr_rmrr++;
 
     } while ( *s++ == ';' && nr_rmrr < MAX_USER_RMRR );
+
+    return *s ? -EINVAL : 0;
 }
 custom_param("rmrr", parse_rmrr_param);