[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1287771688-14805-44-git-send-email-gregkh@suse.de>
Date: Fri, 22 Oct 2010 11:21:23 -0700
From: Greg Kroah-Hartman <gregkh@...e.de>
To: linux-kernel@...r.kernel.org
Cc: Breno Leitao <leitao@...ux.vnet.ibm.com>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH 44/49] jsm: Remove the uart port on errors
From: Breno Leitao <leitao@...ux.vnet.ibm.com>
If kzmalloc fails, the uart port is not removed causing a leak.
This patch just add another label that removes the uart when the
kzmalloc fails.
Signed-off-by: Breno Leitao <leitao@...ux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/serial/jsm/jsm_driver.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c
index eaf5450..18f5484 100644
--- a/drivers/serial/jsm/jsm_driver.c
+++ b/drivers/serial/jsm/jsm_driver.c
@@ -172,13 +172,15 @@ static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device
jsm_uart_port_init here! */
dev_err(&pdev->dev, "memory allocation for flipbuf failed\n");
rc = -ENOMEM;
- goto out_free_irq;
+ goto out_free_uart;
}
pci_set_drvdata(pdev, brd);
pci_save_state(pdev);
return 0;
+ out_free_uart:
+ jsm_remove_uart_port(brd);
out_free_irq:
jsm_remove_uart_port(brd);
free_irq(brd->irq, brd);
--
1.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists