* [PATCH 1/2] sgiioc4: fix error cleanup path
@ 2008-10-19 18:13 Sergei Shtylyov
2008-10-20 10:17 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-10-19 18:13 UTC (permalink / raw)
To: bzolnier; +Cc: linux-ide, jeremy
The driver "forgot" to call iounmap() if request_mem_region() call failed in
sgiioc4_ide_setup_pci_device(). While fixing this, rename the 'err' label to
'alloc_err' and get rid of the 'err_free' label altogether...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
---
This patch is against the recent Linus' tree.
drivers/ide/pci/sgiioc4.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
Index: linux-2.6/drivers/ide/pci/sgiioc4.c
===================================================================
--- linux-2.6.orig/drivers/ide/pci/sgiioc4.c
+++ linux-2.6/drivers/ide/pci/sgiioc4.c
@@ -617,7 +617,8 @@ sgiioc4_ide_setup_pci_device(struct pci_
printk(KERN_ERR "%s %s -- ERROR: addresses 0x%08lx to 0x%08lx "
"already in use\n", DRV_NAME, pci_name(dev),
cmd_phys_base, cmd_phys_base + IOC4_CMD_CTL_BLK_SIZE);
- return -EBUSY;
+ rc = -EBUSY;
+ goto request_error;
}
/* Initialize the IO registers */
@@ -633,18 +634,17 @@ sgiioc4_ide_setup_pci_device(struct pci_
host = ide_host_alloc(&d, hws);
if (host == NULL) {
rc = -ENOMEM;
- goto err;
+ goto alloc_error;
}
rc = ide_host_register(host, &d, hws);
- if (rc)
- goto err_free;
+ if (!rc)
+ return 0;
- return 0;
-err_free:
ide_host_free(host);
-err:
+ alloc_error:
release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
+ request_error:
iounmap(virt_base);
return rc;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/2] sgiioc4: fix error cleanup path
2008-10-19 18:13 [PATCH 1/2] sgiioc4: fix error cleanup path Sergei Shtylyov
@ 2008-10-20 10:17 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2008-10-20 10:17 UTC (permalink / raw)
To: bzolnier; +Cc: linux-ide
Hello, I wrote:
> The driver "forgot" to call iounmap() if request_mem_region() call failed in
> sgiioc4_ide_setup_pci_device(). While fixing this, rename the 'err' label to
> 'alloc_err' and get rid of the 'err_free' label altogether...
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Don't apply these 2 patches yet, I'm going to recast them to avoid
changing the same code twice...
MBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-20 10:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-19 18:13 [PATCH 1/2] sgiioc4: fix error cleanup path Sergei Shtylyov
2008-10-20 10:17 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).