Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c26ec88e authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds
Browse files

resources: tidy __request_region()



No functional change.  Just return NULL for kzalloc failure immediately,
rather than wrapping the whole function body in the body of an "if".

Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 923f7f69
Loading
Loading
Loading
Loading
+21 −20
Original line number Diff line number Diff line
@@ -630,7 +630,9 @@ struct resource * __request_region(struct resource *parent,
{
	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);

	if (res) {
	if (!res)
		return NULL;

	res->name = name;
	res->start = start;
	res->end = start + n - 1;
@@ -656,7 +658,6 @@ struct resource * __request_region(struct resource *parent,
		break;
	}
	write_unlock(&resource_lock);
	}
	return res;
}
EXPORT_SYMBOL(__request_region);