From: Bjorn Helgaas Date: Mon, 2 Nov 2009 17:45:36 +0000 (-0700) Subject: resources: when allocate_resource() fails, leave resource untouched X-Git-Tag: v2.6.33-rc1~321^2~63 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e5ad9679016275d422e36b12a98b0927d76f556;p=pandora-kernel.git 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 Acked-by: Yinghai Lu Signed-off-by: Bjorn Helgaas Signed-off-by: Jesse Barnes --- Reading git-diff-tree failed