[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220526013839.471987-1-niejianglei2021@163.com>
Date: Thu, 26 May 2022 09:38:39 +0800
From: Jianglei Nie <niejianglei2021@....com>
To: bootc@...tc.net, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux1394-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Jianglei Nie <niejianglei2021@....com>
Subject: [PATCH] scsi: target: sbp: Fix memory leak in sbp_management_request_logout()
When req->node_addr != login->sess->node_id, sbp_management_request
_logout() returns without releasing the login, which may lead to a
potential memory leak.
We can fix it by calling sbp_login_release() before the function returns.
Signed-off-by: Jianglei Nie <niejianglei2021@....com>
---
drivers/target/sbp/sbp_target.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index 504670994fb4..76f3ec58a24b 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -575,6 +575,7 @@ static void sbp_management_request_logout(
req->status.status = cpu_to_be32(
STATUS_BLOCK_RESP(STATUS_RESP_REQUEST_COMPLETE) |
STATUS_BLOCK_SBP_STATUS(SBP_STATUS_ACCESS_DENIED));
+ sbp_login_release(login, true);
return;
}
--
2.25.1
Powered by blists - more mailing lists