lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200528102056.911825-1-hslester96@gmail.com>
Date:   Thu, 28 May 2020 18:20:56 +0800
From:   Chuhong Yuan <hslester96@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Chris Boot <bootc@...tc.net>,
        "Martin K . Petersen" <martin.petersen@...cle.com>,
        Nicholas Bellinger <nab@...ux-iscsi.org>,
        Stefan Richter <stefanr@...6.in-berlin.de>,
        linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
        linux1394-devel@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] sbp-target: add the missed kfree() in an error path

sbp_fetch_command() forgets to call kfree() in an error path.
Add the missed call to fix it.

Fixes: a511ce339780 ("sbp-target: Initial merge of firewire/ieee-1394 target mode support")
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
 drivers/target/sbp/sbp_target.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index e4a9b9fe3dfb..504a755ea344 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -1128,8 +1128,10 @@ static int sbp_fetch_command(struct sbp_target_request *req)
 				req->orb_pointer + sizeof(req->orb),
 				req->cmd_buf + sizeof(req->orb.command_block),
 				copy_len);
-		if (ret != RCODE_COMPLETE)
+		if (ret != RCODE_COMPLETE) {
+			kfree(req->cmd_buf);
 			return -EIO;
+		}
 	}
 
 	return 0;
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ