sbp-target: add the missed kfree() in an error path
Subsystems (3)
PATCH 1/1 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.
--- drivers/target/sbp/sbp_target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/target/sbp/sbp_target.c +3 -1
@@ -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 ;
Signature · 1 line
2.26.2
Quoted 2 lines · Chuhong Yuan
sbp_fetch_command()forgets to callkfree()in an error path. Add the missed call to fix it.
Hi Chris,
The changelog of the code under drivers/target/sbp makes we wonder whether this driver has ever had any other users than its original author. Do you agree with this? If so, do you want to keep this driver in the kernel tree?
Thanks,
Bart.
Chris Boot
maintainerQuoted 10 lines · Bart Van Assche
Quoted 2 lines · Chuhong Yuan
sbp_fetch_command()forgets to callkfree()in an error path. Add the missed call to fix it.Hi Chris,
The changelog of the code under
drivers/target/sbpmakes we wonder whether this driver has ever had any other users than its original author. Do you agree with this? If so, do you want to keep this driver in the kernel tree?
Hi Bart,
I think you might be right. I also don't have much time to maintain it these days and the hardware I had is long dead. It probably should be removed for everyone's sanity.
Best regards,
Chris
Signature · 2 lines
Chris Boot [email protected]
Chris,
Quoted 2 lines
I think you might be right. I also don't have much time to maintain it these days and the hardware I had is long dead.
In that case I'd appreciate a patch to remove it.
Thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering