From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Jianglei Nie <niejianglei2021@163.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Sasha Levin <sashal@kernel.org>,
sre@kernel.org, kuba@kernel.org, wangqing@vivo.com
Subject: [PATCH AUTOSEL 4.9 05/10] HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()
Date: Wed, 12 Oct 2022 20:27:52 -0400 [thread overview]
Message-ID: <20221013002802.1896096-5-sashal@kernel.org> (raw)
In-Reply-To: <20221013002802.1896096-1-sashal@kernel.org>
From: Jianglei Nie <niejianglei2021@163.com>
[ Upstream commit b28dbcb379e6a7f80262c2732a57681b1ee548ca ]
ssip_pn_open() claims the HSI client's port with hsi_claim_port(). When
hsi_register_port_event() gets some error and returns a negetive value,
the HSI client's port should be released with hsi_release_port().
Fix it by calling hsi_release_port() when hsi_register_port_event() fails.
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hsi/clients/ssi_protocol.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
index 802afc98e8bd..09e6be746d1e 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -932,6 +932,7 @@ static int ssip_pn_open(struct net_device *dev)
if (err < 0) {
dev_err(&cl->device, "Register HSI port event failed (%d)\n",
err);
+ hsi_release_port(cl);
return err;
}
dev_dbg(&cl->device, "Configuring SSI port\n");
--
2.35.1
next prev parent reply other threads:[~2022-10-13 0:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 0:27 [PATCH AUTOSEL 4.9 01/10] media: cx88: Fix a null-ptr-deref bug in buffer_prepare() Sasha Levin
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 02/10] scsi: 3w-9xxx: Avoid disabling device if failing to enable it Sasha Levin
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 03/10] hid: topre: Add driver fixing report descriptor Sasha Levin
2022-10-17 12:48 ` Pavel Machek
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 04/10] HID: roccat: Fix use-after-free in roccat_read() Sasha Levin
2022-10-13 0:27 ` Sasha Levin [this message]
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 06/10] usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info() Sasha Levin
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 07/10] usb: musb: Fix musb_gadget.c rxstate overflow bug Sasha Levin
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 08/10] Revert "usb: storage: Add quirk for Samsung Fit flash" Sasha Levin
2022-10-17 12:46 ` Pavel Machek
2022-10-17 14:57 ` Greg Kroah-Hartman
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 09/10] staging: octeon: Fix return type of cvm_oct_xmit and cvm_oct_xmit_pow Sasha Levin
2022-10-13 5:53 ` Greg Kroah-Hartman
2022-10-13 0:27 ` [PATCH AUTOSEL 4.9 10/10] usb: idmouse: fix an uninit-value in idmouse_open Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221013002802.1896096-5-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=niejianglei2021@163.com \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
--cc=stable@vger.kernel.org \
--cc=wangqing@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome