]> git.baikalelectronics.ru Git - kernel.git/commit
resources: fix call to alignf() in allocate_resource()
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 20 Dec 2009 09:50:02 +0000 (10:50 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 21 Dec 2009 18:42:29 +0000 (10:42 -0800)
commit6609704cc29bcc4de63b8c22ac418d934e972ff8
tree80c1ab46950ba15ed04ff6f8a6b8a032d6fbeafa
parent0c2592f6ba8f0a7452cde5a09d6df58ebedfb157
resources: fix call to alignf() in allocate_resource()

The second parameter to alignf() in allocate_resource() must
reflect what new resource is attempted to be allocated, else
functions like pcibios_align_resource() (at least on x86) or
pcmcia_align() can't work correctly.

Commit 2ffa6fad3747455d99e27e99774881758f50aa4f broke this by
setting the "new" resource until we're about to return success.
To keep the resource untouched when allocate_resource() fails,
a "tmp" resource is introduced.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/resource.c