xen/drivers/passthrough/vtd/dmar.c: let custom parameter parsing routines return...
authorJuergen Gross <jgross@suse.com>
Wed, 23 Aug 2017 17:36:00 +0000 (19:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Aug 2017 14:20:44 +0000 (16:20 +0200)
Modify the custom parameter parsing routines in:

xen/drivers/passthrough/vtd/dmar.c

to indicate whether the parameter value was parsed successfully.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/dmar.c

index 82040ddc05d75a68a11418b5e9930d93c1bae00a..dd122da730b35242e5b8bdec9718588dd93417d3 100644 (file)
@@ -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);