diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-09-22 14:22:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-26 13:19:32 +0200 |
commit | 6066bd69ffba3a6abc7c0793ccba1da79b7d77e3 (patch) | |
tree | 2a9191b359ec545ef9221aff74f0fc024bb5cac7 | |
parent | 565640ded3445737a7a3f7ac7d58d134a6b6303a (diff) | |
download | linux-stable-6066bd69ffba3a6abc7c0793ccba1da79b7d77e3.tar.gz linux-stable-6066bd69ffba3a6abc7c0793ccba1da79b7d77e3.tar.bz2 linux-stable-6066bd69ffba3a6abc7c0793ccba1da79b7d77e3.zip |
drivers: serial: jsm: fix some leaks in probe
[ Upstream commit 1d5859ef229e381f4db38dce8ed58e4bf862006b ]
This error path needs to unwind instead of just returning directly.
Fixes: 03a8482c17dd ("drivers: serial: jsm: Enable support for Digi Classic adapters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YyxFh1+lOeZ9WfKO@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/tty/serial/jsm/jsm_driver.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 592e51d8944e..07e9be9865c7 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -212,7 +212,8 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) break; default: - return -ENXIO; + rc = -ENXIO; + goto out_kfree_brd; } rc = request_irq(brd->irq, brd->bd_ops->intr, IRQF_SHARED, "JSM", brd); |