]> git.itanic.dy.fi Git - linux-stable/commit
HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()
authorJianglei Nie <niejianglei2021@163.com>
Mon, 5 Sep 2022 07:48:01 +0000 (15:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Oct 2022 10:39:23 +0000 (12:39 +0200)
commite78b45b3eeee1cec77c794fcbf0512537c20b1dc
tree935ad5c12071d2790e318c7439e2c8f93409f24a
parent8a251549ab577d64ece210a11c404354479bd635
HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()

[ 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