X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=kernel%2Fresource.c;h=790f1b807f1285b12557325823ed782d83a84a65;hb=933af93aaaf22df98f8ccf772cc4a70dfcd076bb;hp=54ba6de3757c7ebdc83ad7f6c5b3d22b9d20f600;hpb=124dcf7960d6832ca72c1cad8a6d87fef756b34e;p=mirror_ubuntu-bionic-kernel.git diff --git a/kernel/resource.c b/kernel/resource.c index 54ba6de3757c..790f1b807f12 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -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;