Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abf4f6a5 authored by Breno Leitao's avatar Breno Leitao Committed by Greg Kroah-Hartman
Browse files

jsm: Remove the uart port on errors



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: default avatarBreno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7d172bfe
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);