From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C176C4332F for ; Mon, 30 Oct 2023 13:30:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233448AbjJ3NaA (ORCPT ); Mon, 30 Oct 2023 09:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233436AbjJ3N37 (ORCPT ); Mon, 30 Oct 2023 09:29:59 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 728DAC6; Mon, 30 Oct 2023 06:29:57 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id AF9C26732A; Mon, 30 Oct 2023 14:29:54 +0100 (CET) Date: Mon, 30 Oct 2023 14:29:54 +0100 From: Christoph Hellwig To: Christophe JAILLET Cc: Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Hannes Reinecke , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-nvme@lists.infradead.org Subject: Re: [PATCH] nvme-tcp: Fix a memory leak Message-ID: <20231030132954.GD21741@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 29, 2023 at 10:22:57PM +0100, Christophe JAILLET wrote: > 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; I'd slightly prefer the code to be consistent how it assigns to err, and use the style where it is assigned in the main path as with the -EINVAL for the next checks. Except for that this looks good: Reviewed-by: Christoph Hellwig