Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp180709rwi; Wed, 12 Oct 2022 18:13:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4K8mq+hQeM+sVv83Td8Qo43mGg3nuy2Mv8YxxJvnc7+wvm0HVP5IKsmoTJRNLyK0VjveHS X-Received: by 2002:a05:6a00:cce:b0:565:cbe0:16c6 with SMTP id b14-20020a056a000cce00b00565cbe016c6mr3404500pfv.56.1665623603487; Wed, 12 Oct 2022 18:13:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665623603; cv=none; d=google.com; s=arc-20160816; b=y0KCY7tP0UPTlog5CjHR0uTPca1PRdbtjrJIMJhwmbpGsXUxPCFPYNGIMM4KLtW9DK AumHTO+hhzuQoq3x9fNtoUvDxdsyh/fBUv/PoWtu0X4kqjl0/srmmFFbO0jEBONx+vZr XuANbLSyaReGx9UpRkvPT4taMu4d4qI8HUrYfY9nBqNBEHLQqOrFxcyt41Y/0XwoGDzi 5PEckgjTHEtlO8ZDTZqwQ72j5oobQT8/p0I5Y5t7H53vrZfzCd6J76WQBBDftliQtdtb Lk9YXZDpp/CpFVMLBXkSY8ob5D4PE//oA7khNUxFxVEhOEtvPGzxAc70pIk0vL1BVuQa UF3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wN0V3GACbIS8Mo2Qofdh6tu/+edw+5+w+NvBy3Yjc3A=; b=No1otfKyOR5o4FlSNhIkbb4TcB1/7s7CFWWYvlGqUYPIQQbEaVKFpKm+bssNKpthoa hjQBTPuoCYYTjkkRc1G6BDojHlC8khZZ/UCDfWAafGytb2RE/+aNt/ZZTR1dnLK2WjFG sxRNwFKf76fl+qmyXVvpdL36w0w2+2mQxvxZrFjlHDl6b8PBDXmLbx4ZSkr6nxL/9l4o B7AAbFu0mEA4prUHbSjVUfBcZf0EePXa83iQCpUqrGKr/iYD9kbi/5qJ1ro1cV1SdtUp uoO0+f+QkkN6sdgzR2bKGx6uRpA2NRc/JF98mkIGHWpGo1HNwhqJlO79j0iG9O/jI8wh vB3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sbLOjpX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo3-20020a17090b1c8300b0020087bc6415si4080475pjb.16.2022.10.12.18.13.11; Wed, 12 Oct 2022 18:13:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sbLOjpX8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230009AbiJMASJ (ORCPT + 99 others); Wed, 12 Oct 2022 20:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbiJMARe (ORCPT ); Wed, 12 Oct 2022 20:17:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17087197F85; Wed, 12 Oct 2022 17:17:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7CE29616B5; Thu, 13 Oct 2022 00:17:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4CCAC433C1; Thu, 13 Oct 2022 00:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620220; bh=SbOlvIFkuyxyhYg20Cv9c7JE7j32qJ/p3yVbNpY/YwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sbLOjpX8SwzcE+BmVmRt56gUlrgH5wwO+/yY0wsRQ+jmerL+/vtUN7SEqhAHofLc6 Lq7ookL6zKZaM9DXlIELbUQiPAakmyW1ioZ07n+tPRiQ80vG5qZwjPhjeYx0xrIGvn Sk/pElPPEWFZH++nFjGBQdmpJr+i6R7V01DeDfoiTosvKZk2WlkSIrwoxVeyZDtJx7 ExRMe9DWMCCclmGGdQozDx9XRLiVwpmoWIt6KZ1oIjhZIADotcKPoIMyNzNCnLjfo9 pFPajDOmFy3qeylS8PGpM/koNTjnfkaI23+xQR+d2vKM+4hjzBgc9wO8tHGloLroG3 udQQ3Y2vbB8QA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jackie Liu , Genjian Zhang , Sagi Grimberg , Chaitanya Kulkarni , Hannes Reinecke , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 6.0 26/67] nvmet-auth: clean up with done_kfree Date: Wed, 12 Oct 2022 20:15:07 -0400 Message-Id: <20221013001554.1892206-26-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jackie Liu [ Upstream commit 42147981561c3344d2c6781fe7029e5900daa9fb ] Jump directly to done_kfree to release d, which is consistent with the code style behind. Reported-by: Genjian Zhang Signed-off-by: Jackie Liu Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/target/fabrics-cmd-auth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c index ebdf9aa81041..8458ec40340b 100644 --- a/drivers/nvme/target/fabrics-cmd-auth.c +++ b/drivers/nvme/target/fabrics-cmd-auth.c @@ -229,10 +229,8 @@ void nvmet_execute_auth_send(struct nvmet_req *req) } status = nvmet_copy_from_sgl(req, 0, d, tl); - if (status) { - kfree(d); - goto done; - } + if (status) + goto done_kfree; data = d; pr_debug("%s: ctrl %d qid %d type %d id %d step %x\n", __func__, -- 2.35.1