]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - kernel/resource.c
drm/i915: Save the old CDCLK atomic state
[mirror_ubuntu-bionic-kernel.git] / kernel / resource.c
index 54ba6de3757c7ebdc83ad7f6c5b3d22b9d20f600..790f1b807f1285b12557325823ed782d83a84a65 100644 (file)
@@ -651,7 +651,8 @@ static int __find_resource(struct resource *root, struct resource *old,
                        alloc.start = constraint->alignf(constraint->alignf_data, &avail,
                                        size, constraint->align);
                        alloc.end = alloc.start + size - 1;
-                       if (resource_contains(&avail, &alloc)) {
+                       if (alloc.start <= alloc.end &&
+                           resource_contains(&avail, &alloc)) {
                                new->start = alloc.start;
                                new->end = alloc.end;
                                return 0;