[xen staging-4.9] rangeset: make inquiry functions tolerate NULL inputs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen staging-4.9] rangeset: make inquiry functions tolerate NULL inputs

patchbot
commit a6100f3edea860d3e82d9f5f191971b05cfa15da
Author:     Jan Beulich <[hidden email]>
AuthorDate: Fri Sep 14 13:28:40 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Fri Sep 14 13:28:40 2018 +0200

    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 <[hidden email]>
    Signed-off-by: Jan Beulich <[hidden email]>
    Reviewed-by: Roger Pau Monné <[hidden email]>
    Reviewed-by: Wei Liu <[hidden email]>
    master commit: ad0a9f273d6d6f0545cd9b708b2d4be581a6cadd
    master date: 2018-08-17 13:54:40 +0200
---
 xen/common/rangeset.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index 6c6293c15c..80b2f072ba 100644
--- 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));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.9


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog