Bjorn Helgaas 1e5ad96790 resources: when allocate_resource() fails, leave resource untouched
When "allocate_resource(root, new, size, ...)" fails, we currently
clobber "new".  This is inconvenient for the caller, who might care
about the original contents of the resource.

For example, when pci_bus_alloc_resource() fails, the "can't allocate
mem resource %pR" message from pci_assign_resources() currently contains
junk for the resource start/end.

This patch delays the "new" update until we're about to return success.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-11-04 13:06:46 -08:00
..
2009-09-21 14:29:21 +02:00
2009-10-29 07:39:25 -07:00
2009-09-18 09:48:52 -07:00
2009-08-29 14:10:07 +02:00
2009-09-19 13:13:17 -07:00
2009-07-24 10:53:29 +02:00
2009-10-29 08:56:20 +10:30
2009-10-07 08:11:20 +02:00
2009-07-12 14:03:27 -07:00
2009-09-23 18:13:10 -07:00