[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] rangeset: make inquiry functions tolerate NULL inputs



Rather than special casing the ->iomem_caps check in x86's
get_page_from_l1e() for the dom_xen case, let's be more tolerant in
general, along the lines of rangeset_is_empty(): A never allocated
rangeset can't possibly contain or overlap any range.

Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -256,6 +256,9 @@ bool_t rangeset_contains_range(
 
     ASSERT(s <= e);
 
+    if ( !r )
+        return false;
+
     read_lock(&r->lock);
     x = find_range(r, s);
     contains = (x && (x->e >= e));
@@ -272,6 +275,9 @@ bool_t rangeset_overlaps_range(
 
     ASSERT(s <= e);
 
+    if ( !r )
+        return false;
+
     read_lock(&r->lock);
     x = find_range(r, e);
     overlaps = (x && (s <= x->e));




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.