From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8261BA0547; Mon, 24 May 2021 14:14:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1533C41128; Mon, 24 May 2021 14:14:57 +0200 (CEST) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mails.dpdk.org (Postfix) with ESMTP id 1D2B84003C; Mon, 24 May 2021 14:14:55 +0200 (CEST) Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fpbgb6xpPzmZyP; Mon, 24 May 2021 20:12:27 +0800 (CST) Received: from dggeme756-chm.china.huawei.com (10.3.19.102) by dggems702-chm.china.huawei.com (10.3.19.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 20:14:47 +0800 Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 20:14:47 +0800 To: Thierry Herbelot , CC: Thomas Monjalon , , "Cristian Dumitrescu" , Jasvinder Singh References: <20210524085737.15717-1-thierry.herbelot@6wind.com> <20210524113023.28553-1-thierry.herbelot@6wind.com> From: "Min Hu (Connor)" Message-ID: <1bbd10bb-c721-d079-ccd0-7dab42743886@huawei.com> Date: Mon, 24 May 2021 20:14:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210524113023.28553-1-thierry.herbelot@6wind.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v2] sched: check newly allocated pointer X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Thierry, This bug has been fixed in my earlier patch, please refer to: https://patches.dpdk.org/project/dpdk/patch/1619175672-20016-2-git-send-email-humin29@huawei.com/ Thanks. ÔÚ 2021/5/24 19:30, Thierry Herbelot дµÀ: > Check port->subport_profiles after it was allocated. > > Fixes: 0ea4c6afcaf14 ("sched: add subport profile table") > Cc: stable@dpdk.org > Cc: Cristian Dumitrescu > Cc: Jasvinder Singh > > Signed-off-by: Thierry Herbelot > -- > V2: reword patch title > --- > lib/sched/rte_sched.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c > index cd87e688e489..4a2c0e27550d 100644 > --- a/lib/sched/rte_sched.c > +++ b/lib/sched/rte_sched.c > @@ -961,7 +961,7 @@ rte_sched_port_config(struct rte_sched_port_params *params) > /* Allocate memory to store the subport profile */ > port->subport_profiles = rte_zmalloc_socket("subport_profile", size2, > RTE_CACHE_LINE_SIZE, params->socket); > - if (port == NULL) { > + if (port->subport_profiles == NULL) { > RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__); > > return NULL; >