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 45BCF41EB2; Thu, 16 Mar 2023 19:20:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 365B040DF6; Thu, 16 Mar 2023 19:20:57 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by mails.dpdk.org (Postfix) with ESMTP id DCA4840DDC for ; Thu, 16 Mar 2023 19:20:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OXc9+v7MVlTZ0xwHJOiuNwhOMhehLTC/dGFlD4YT+i64BTSz5auMz1nbV5zCuOkUSA/fCtX5XK/Gqp2tyRARJS3ecON2wcoPjjnnDMI/noucbK/6oc6335joV0yODPoptQXTwUhkliSI+G8m4I3bPICLL1zxoBMHJOlxZI+8q6+5f7I99XFHmfclrhkUXnysVUA/6o6eK2N+S6J12wjChWiCOxZPjiNSHjba6nf5BaekBdA9VTglsNdrW30/FroCCouVAe/gdwlUfjPe9attaeOG6GHPLZ5qihXdVqUtrKRB2InJgsicNtGLmA/vlkrb0EeOfqLrJrdEk4fPCxUJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kQ1vyv7kdFWWAjjR9Tdw7BcW2n1HwQuu34F4wfPdDwA=; b=AdObLNaj1LgZvlw1oh25FwGg36l/3viVsuZk1PgY8hNVEiV6Mv6NBsX9pBYIoGDgKQN1CS4x9Muzh5isBzBCR5oGcAbpEsDawCgAovtLGbl+nBGZDArMl66uu7NFTTjFpE/rYO2VzMreoBEzQafIDmiaDcf+iD1qYmp7tlvLiVkuHdNXskVyqjsH8FVnMLDzUpTHl3Bypz+9uFji/uxGZ4Bt+KnhVw8pjP9/JrfyUoFRTeYn12xbaJEl04wgGVjwwFB5BUpWlBXkLN8oWbsPiB/x18H+rge1kgaFoPZOeFW9RiZboiqks58tykhaxJBsa+kmcR2i6mHEqnw1Ib7Y6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kQ1vyv7kdFWWAjjR9Tdw7BcW2n1HwQuu34F4wfPdDwA=; b=XVtcFKbQVc5JdfWL6DGqrf3puTn470XQ4RFJMsSunyEbTa63ja1IEbdd236Oseu5JWuA/Urq3CoDoyojIu5rK5z+IvFGTMeOAoCfhUh/emO0/IMKFmvyp5YMgm6UcXCZNKyBnKOKEN0+jAZ0T1qfBIeqrzJPayVFMVYcXpYldFU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by IA1PR12MB8494.namprd12.prod.outlook.com (2603:10b6:208:44c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.29; Thu, 16 Mar 2023 18:20:52 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.026; Thu, 16 Mar 2023 18:20:52 +0000 Message-ID: Date: Thu, 16 Mar 2023 18:20:47 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Chengwen Feng , thomas@monjalon.net, Andrew Rybchenko , Roman Zhukov , Andrew Lee , Robert Stonehouse , Ferruh Yigit , Andy Moreton Cc: dev@dpdk.org References: <20230314124813.39521-1-fengchengwen@huawei.com> <20230314124813.39521-6-fengchengwen@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH 5/5] net/sfc: fix segment fault when parse devargs In-Reply-To: <20230314124813.39521-6-fengchengwen@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P123CA0026.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB8494:EE_ X-MS-Office365-Filtering-Correlation-Id: a3054784-6f3c-4e26-7a13-08db264b2d11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /fr4oWJ4n+HL213N+hzIVwQoCExCTlYzXYhbYtyLgqC8QCtHn45iqrBTn+l/zKWIbI9MyR5JCcZHHW3Hgs41zYHheRkDnJHyQvzbxHpCuMfqRcvClCzjkY7Hl4H0HfxKNL1za+r/pfs1SzvlFengegS0qU9mMSk6l6USHTuU+a+T1b9g4+NT13YXfPzByAc0l2Qqd0zpRGUNErlRoaN8sQU2LZCqIeURcbE583LsLwehWTgWn82DW6BA0DCYOYEpK68N1gA6cTlzV5N+GPdWlEdE6Bg0gA7lQ6BsJeoGCy5VvHNMm3RX1w993ciQ5DSh3lfaSqhseag6zjbfxs3vWTLbgfNqopRoaRYAWY5gjLpcdcqpVJtlyzZk2pfqeFzy44WR0iWe0Kz27L58HAmAj8Q+wZ7KwbGEBh2P9QASiXsiktFk4u74gXVJTnB+Ar5rmGl91EpnAyQyXxFZRaMk+6+iMMIwfoSd3dXHvukryb7cNS3HwS7C3ir0Smzr6EmHIO8rXH78aE+XFL/wIt2ovjvI57snpKXGmna4RyfbEeuSoNPL6xxdI5R8hzLRs+GVEWIWhrc9QHfnWSdNtttHla0/yjhVW9pzwJZk6/D1/HSmL4j+EEOCu6fDgtXvG88GsMv512yC8/ZytiZnv6Q78c8X1hDH4q5XQ10CNYqy+9u5TE2CQvN9qgmLHUtJCBA3y67Aq4kr9unubMP1c2/Fs1wy59AmaDfFKcmn2fjtkhs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(366004)(396003)(451199018)(36756003)(38100700002)(31696002)(5660300002)(41300700001)(2906002)(44832011)(8936002)(86362001)(4326008)(6486002)(2616005)(6506007)(53546011)(26005)(316002)(110136005)(6512007)(186003)(66476007)(6666004)(66946007)(478600001)(8676002)(66556008)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cktrQTBKSFNCbS8wOWg3MFNMeGYrakxKTXhLeTcvZGhLU2Z2dE4xMktIU1hX?= =?utf-8?B?RnJrMGdnZHR4NEZjc21xM1kyRktjZmI4WWpVSmlCSi9VYUpxR3llczdVS3Qy?= =?utf-8?B?NWtkbWxieWxkRERKY0lGc2tkSHAyc1NRUVRsQXkvTjFNOGtKY3doRUpQdXNv?= =?utf-8?B?bXFXNmhYUWhEWUcxNVh3NVhtSlRtdmVnbW5saVMzb0JQSXNVY09LLzA1YmVu?= =?utf-8?B?VTNzNVM2R3lFb2RZQVhvei9FcDBibUpOZElCaGtDZG50bktqNWozV3NqUWhC?= =?utf-8?B?UTdlNn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0MGxTQm1OblNW?= =?utf-8?Q?VGimdTKYjuXM00eDl2tF8jcDY?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3054784-6f3c-4e26-7a13-08db264b2d11 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2023 18:20:52.5611 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NJjdF/Oy9aZabQNOf61mct63vg9SMUoCFfAckVbytSAvekLK0b3hUE5QK8gg+S62 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8494 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 On 3/14/2023 12:48 PM, Chengwen Feng wrote: > The rte_kvargs_process() was used to parse KV pairs, it also supports > to parse 'only keys' (e.g. socket_id) type. And the callback function > parameter 'value' is NULL when parsed 'only keys'. > > This patch fixes segment fault when parse input args with 'only keys'. > > Fixes: 9e7fc8b8f3be ("net/sfc: add device parameter to choose FW variant") > Fixes: c22d3c508e0c ("net/sfc: support parameter to choose performance profile") > Fixes: 63d588ff2692 ("net/sfc: libefx-based driver stub") > Fixes: df1bfde4ff0d ("net/sfc: factor out libefx-based Rx datapath") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng <...> > index 783cb43ae6..f77c4af345 100644 > --- a/drivers/net/sfc/sfc_kvargs.c > +++ b/drivers/net/sfc/sfc_kvargs.c > @@ -85,6 +85,9 @@ sfc_kvarg_bool_handler(__rte_unused const char *key, > }; > bool *value = opaque; > > + if (!key || !opaque) > + return -EINVAL; s/key/value_str/ ? And better to be consistent with compression syntax, `!ptr` vs `ptr == NULL"