[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28a41bf1-661b-47e3-8b7e-65cb64a0b8bc@suse.de>
Date: Tue, 31 Oct 2023 08:09:51 +0100
From: Hannes Reinecke <hare@...e.de>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-nvme@...ts.infradead.org
Subject: Re: [PATCH] nvme-tcp: Fix a memory leak
On 10/29/23 22:22, Christophe JAILLET wrote:
> All error handling path end to the error handling path, except this one.
> Go to the error handling branch as well here, otherwise 'icreq' and
> 'icresp' will leak.
>
> Fixes: 2837966ab2a8 ("nvme-tcp: control message handling for recvmsg()")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> drivers/nvme/host/tcp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
> index 4714a902f4ca..3c35c37112e6 100644
> --- a/drivers/nvme/host/tcp.c
> +++ b/drivers/nvme/host/tcp.c
> @@ -1429,7 +1429,8 @@ static int nvme_tcp_init_connection(struct nvme_tcp_queue *queue)
> if (ctype != TLS_RECORD_TYPE_DATA) {
> pr_err("queue %d: unhandled TLS record %d\n",
> nvme_tcp_queue_id(queue), ctype);
> - return -ENOTCONN;
> + ret = -ENOTCONN;
> + goto free_icresp;
> }
> }
> ret = -EINVAL;
Reviewed-by: Hannes Reinecke <hare@...e.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
Powered by blists - more mailing lists