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 02CB1A0A0E; Thu, 29 Apr 2021 04:34:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E50B74112A; Thu, 29 Apr 2021 04:34:52 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id D2B2F4003E for ; Thu, 29 Apr 2021 04:34:51 +0200 (CEST) Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FVzzn3xFBz16MZ4; Thu, 29 Apr 2021 10:32:21 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Thu, 29 Apr 2021 10:34:48 +0800 To: Stephen Hemminger CC: , , , References: <1618967837-2341-1-git-send-email-humin29@huawei.com> <1618967837-2341-3-git-send-email-humin29@huawei.com> <20210420193317.7ffe5275@hermes.local> From: "Min Hu (Connor)" Message-ID: <00496729-2eda-0790-ebe8-43391ab36c09@huawei.com> Date: Thu, 29 Apr 2021 10:34:49 +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: <20210420193317.7ffe5275@hermes.local> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH 2/2] eal: fix service core index validity 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, fixed in v2, thanks. ÔÚ 2021/4/21 10:33, Stephen Hemminger дµÀ: > On Wed, 21 Apr 2021 09:17:17 +0800 > "Min Hu (Connor)" wrote: > >> idx = strtoul(corelist, &end, 10); >> if (errno || end == NULL) >> return -1; >> + if (idx < 0 || idx >= RTE_MAX_LCORE) > > Wondered at first how strtoul() could ever return an negative value but then > noticed that idx is int here. > > The code that does would be clearer and safer if the variables were an unsigned > type. idx, min, max should be the same type everywhere. > > Looks like the original code was written in old C style of "all the world's an int" > . >