Patch "HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    HSI: ssi_protocol: fix potential resource leak in ssip_pn_open()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hsi-ssi_protocol-fix-potential-resource-leak-in-ssip.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 521247f5e382920cc0b1ddb76fb92d0ec87be09b
Author: Jianglei Nie <niejianglei2021@xxxxxxx>
Date:   Mon Sep 5 15:48:01 2022 +0800

    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@xxxxxxx>
    Signed-off-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
index 96d0eccca3aa..f202751484aa 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -931,6 +931,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");



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux