Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1715543pxj; Wed, 19 May 2021 12:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymiAISl4sLMtnEA2+JGZpBYDwImtul/DjuReTieIIkKze1HTlEqCkBzORaa+XWWKcP10h2 X-Received: by 2002:a17:906:840c:: with SMTP id n12mr629395ejx.431.1621451462957; Wed, 19 May 2021 12:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451462; cv=none; d=google.com; s=arc-20160816; b=Dxbwte3KrRa4uOMJmVWZgdaFnbJuQuNCGSEp2Aets1XwUsFwlZaX/mRQPyr6kdWrLR K/fVS4Dj+fauw4ECMZb6Nt0umPgD2Au5o4iuVwkOZLvtrHYNTM0ekPtq1RoInnuIKHx1 4POx5oGVyXPDR4fAO8PcPgyNKubPvb+7zm5ZE7mXGENTDM+SCjxMQIBEzk2P3XtyrwvG XzciAhSLnqZm0Nr9e96IE2dypVNQHKKAwBqQhXLGmLs1xmAKxBPAiCGbBrIsmY9iO+XQ xuX6/9J4oohnnzEu8+gEvlzIuDZs3CCT3h3tfnJbDPTIZdwlolJ79GxHw5++TifdWHaE HR8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=zOWIg0ZhkA5qh7hVNavc5PbVc6LM1T3fR120XfHVQSU=; b=uBeJRT6ESf8PtbL4e/GZ4iq0FUGVBydru0klDWceuAuuFa7xk6W+9AJcfuPwnM0lDG FxNblGKk6zdF501QLv9oShu9hLD559DfGSkaSC+H3GVldcsD4IVqiewQ7pb3pyuA9KWo fFVb8z3Ro5IFxvVoeju7X/8MVkyKbu2pNioI9kUOqOD2xZHtjqajpHFNR1OP/0/O2Bm3 ANYN/KiTGZdKzOmLOAMtX8/iugHCV0vcEgwzJm5vjwc626N4WjDx6HhaetWgr8r/sj2T gHxu5CTyghO9tkiQt6Gb3SgfCxsWXYZ1L1F0HEE7uztuM76Ipv4035Ecxwrb/u+t8abj /h8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bw22si461236ejb.745.2021.05.19.12.10.38; Wed, 19 May 2021 12:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353268AbhESEdq (ORCPT + 99 others); Wed, 19 May 2021 00:33:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:2977 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbhESEdk (ORCPT ); Wed, 19 May 2021 00:33:40 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FlKdm1mzzzCst2; Wed, 19 May 2021 12:29:32 +0800 (CST) Received: from dggpeml500019.china.huawei.com (7.185.36.137) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 12:32:18 +0800 Received: from [10.174.179.189] (10.174.179.189) by dggpeml500019.china.huawei.com (7.185.36.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 19 May 2021 12:32:18 +0800 Subject: Re: [PATCH] nvmet: fix memory leak on nvmet_alloc_ctrl() To: Chaitanya Kulkarni , "kbusch@kernel.org" CC: "hch@lst.de" , "sagi@grimberg.me" , "amit.engel@dell.com" , "linux-nvme@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "linfeilong@huawei.com" References: <1621327598-542045-1-git-send-email-wubo40@huawei.com> From: Wu Bo Message-ID: Date: Wed, 19 May 2021 12:32:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.189] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500019.china.huawei.com (7.185.36.137) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/5/19 4:27, Chaitanya Kulkarni wrote: > On 5/18/21 01:21, Wu Bo wrote: >> From: Wu Bo >> >> When cntlid_min is greater than cntlid_max, >> goto wrong label, should be goto out_free_sqs >> label. Otherwise there is a memory leak problem >> on the nvmet_alloc_ctrl function(). >> >> Fixes: 94a39d61f80f ("nvmet: make ctrl-id configurable") >> Fixes: 6d65aeab7bf6e ("nvmet: remove unused ctrl->cqs") >> Signed-off-by: Wu Bo >> --- > > Looks good, except commit message could be better :- > > When cntlid_min is greater than cntlid_max, goto wrong label, should be > goto out_free_sqs label. Otherwise there is a memory leak problem on the > nvmet_alloc_ctrl function(). > > Fixes: 94a39d61f80f ("nvmet: make ctrl-id configurable") > Fixes: 6d65aeab7bf6 ("nvmet: remove unused ctrl->cqs") > Signed-off-by: Wu Bo > > > with above :- Thanks for your review. I will make the commit message better. and I found the nvmet-loop has a similar issue, will send patch series soon. Thanks, Wu Bo > > Reviewed-by: Chaitanya Kulkarni > > > . >