A patch later in this series allocates child nodes
in this resource tree.  For that to work, this tree
needs to be sorted in ascending order.
Signed-off-by: Jake Oshins <jakeo@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
        new_res->end = end;
 
        /*
-        * Stick ranges from higher in address space at the front of the list.
         * If two ranges are adjacent, merge them.
         */
        do {
                        break;
                }
 
-               if ((*old_res)->end < new_res->start) {
+               if ((*old_res)->start > new_res->end) {
                        new_res->sibling = *old_res;
                        if (prev_res)
                                (*prev_res)->sibling = new_res;