Commit:     fb4d64e78ceab77cf20f7796f74aa10ebe862032
Parent:     f5de611148c8370cbe50796ca5567ca624b99686
Author:     Frederik Deweerdt <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 16 01:27:15 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 16 08:13:55 2007 -0800

    [PATCH] pci_iomap_regions() error handling fix
    It appears that the pcim_iomap_regions() function doesn't get the error
    handling right. It BUGs early at boot with a backtrace along the lines of:
    The following patch allows me to boot. Only the if(mask..) continue;
    part fixes the problem actually, the gotos where changed so that we
    don't try to unmap something we couldn't map anyway.
    Signed-off-by: Frederik Deweerdt <[EMAIL PROTECTED]>
    Cc: Al Viro <[EMAIL PROTECTED]>
    Cc: Tejun Heo <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 lib/devres.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/devres.c b/lib/devres.c
index 2a668dd..eb38849 100644
--- a/lib/devres.c
+++ b/lib/devres.c
@@ -274,21 +274,21 @@ int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, 
const char *name)
                rc = pci_request_region(pdev, i, name);
                if (rc)
-                       goto err_region;
+                       goto err_inval;
                rc = -ENOMEM;
                if (!pcim_iomap(pdev, i, 0))
-                       goto err_iomap;
+                       goto err_region;
        return 0;
- err_iomap:
-       pcim_iounmap(pdev, iomap[i]);
        pci_release_region(pdev, i);
        while (--i >= 0) {
+               if (!(mask & (1 << i)))
+                       continue;
                pcim_iounmap(pdev, iomap[i]);
                pci_release_region(pdev, i);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to