From 25e39ee8982222270f26742832af2caa49ac4df7 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 22 Sep 2025 08:44:11 +0000 Subject: [PATCH] drivers: serial: jsm: fix some leaks in probe stable inclusion from stable-v4.19.262 commit 6066bd69ffba3a6abc7c0793ccba1da79b7d77e3 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/ICY4GJ CVE: CVE-2022-50312 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6066bd69ffba3a6abc7c0793ccba1da79b7d77e3 -------------------------------- [ 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 Link: https://lore.kernel.org/r/YyxFh1+lOeZ9WfKO@kili Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Cai Xinchen --- drivers/tty/serial/jsm/jsm_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- Gitee