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 889BE4240B; Wed, 18 Jan 2023 11:57:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 696E8400D6; Wed, 18 Jan 2023 11:57:32 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2082.outbound.protection.outlook.com [40.107.95.82]) by mails.dpdk.org (Postfix) with ESMTP id C46A24003F for ; Wed, 18 Jan 2023 11:57:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7vxKIw3/X5z1KasaCYfwneipcWN90LL/UahzZ2gLheufs4MpI6KRUdG0fkDZKgFPEgUp+jUgjOF85S1TgYAk7Cd59I3HX4oFzjCQRhpnnkUJhzT+aR2QTYsj9+xPjWDUjRE5VLvaGvCHE7D4afMkU564eHlUMdY6WVQ9l23HNIxNEeNqxA9MUcwdyBY4lWEgXCpq8beLE8X7RLHn0JUICB2WyqlRD0T6pYVmGMF0kvb+yRcHueRTKB2d208pWAFjHaemRwxk629dyX5iznFJudYxphNqcQdX5bKdcsasxT20xSFndFv1sOkTbmRxLzguAWAKHKukPr0kWGl5emKRQ== 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=ZZECw4vvkLkh5C1UqwGBQs2U/toROMAWcvmeT4vBbyA=; b=eac6oLCyeisNIqCv0NVwTqP9GIlxwOG4SYjWL7m7wmGUcchXXVCrjY9NEHCXEtCZxbMb766GZpGfB1MfuwTXCGnEGggK9d5VHlgoK6+Bdmd6jiaohT9BoI1ArHtF6PLuB0M13IRPnfknONaeomLvXDBHpuy5/KkMgfUEwoWovG4rjqMNW/bceAJLobZkSq7j/lU/uW8L+V6XNrFgcLaXatCGz9M8FqNcPjjSsuSjcnCYKHuA/HruNmUNLDP3nuj1I0AIQxcEw0AiOZGjYY572+961W+/a4OdxY66xGnoypSUbrN8VkMrRJzaoWkP/TPjmfWeJKt60tqul/5kPWiSIA== 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=ZZECw4vvkLkh5C1UqwGBQs2U/toROMAWcvmeT4vBbyA=; b=ZqcT5Gtt9eR/2DLJ6ZVBiVJHJ5Tk6Xjq+YGHwR9nYp0e135rsyNSV/uSAzjkSSxl4LBrsfaJr3e57893LeoMM6Scic/yLNHrm30YcGeKBIIGPsSrvLg3+VnAylPq7gBTCol55Pbej4x5e4k7UvQjNZ9RS1G+BuCDe4sKSlk+Y7E= 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 PH7PR12MB5620.namprd12.prod.outlook.com (2603:10b6:510:137::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Wed, 18 Jan 2023 10:57:28 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6002.024; Wed, 18 Jan 2023 10:57:28 +0000 Message-ID: Date: Wed, 18 Jan 2023 10:57:23 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: okaya@kernel.org References: <20221122153053.1172434-1-okaya@kernel.org> <20221122153053.1172434-3-okaya@kernel.org> From: Ferruh Yigit Cc: dev@dpdk.org Subject: Re: [PATCH RESEND v2 02/11] net/tap: check if name is null In-Reply-To: <20221122153053.1172434-3-okaya@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0561.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:33b::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB5620:EE_ X-MS-Office365-Filtering-Correlation-Id: 81c2b146-a08f-4ede-4cc7-08daf942ca51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WVIfA4utJL0ZXPxWUZyrxzUVrrUmjJjUp73ln7rpdiXA13y1+dV02ffrbdQ4BY6N9HywoIhh8COaSymdpnb5JpVtNkxvEQ6VMce4WBFnFY4GzNFID12nS3hjdkC6m/hL/EKAh/SmJHe5/Kz38esr2YVUEIQQdlOxVcHCOmnWdPMTiz+fi9Hn7dqTfa2IGdEnX24cOV+uHQnIRYJLlNIYts5E7QLerE0X02ijOtFk8AeHbiaMfJDCbyTkQieW63Hd8J1ZsiGgH7Kb80J3yUOKAfsslUfhbKUAppOEoA4nIHb60Wnzr8odD2VzuuhrB/vO8iwFGWqf7+y4RZC1aGNZsJxGgEv/cCzNPxKeBcy2tU3U3pAKQQA0f3qgR3EJu5dUwAEheED7keZ4bHndqMP7y2+9mQFPf/DJjTBhb8UoE0WjEZ8tzmRO0ehUHwPIADnRcjurs6yqBs+iNzMsPa+fq/D7K4jndT8cez6nhS11x/7g1rBi4OLFflEYhS1ovdwTzdAWxBso+J6bh3irl4c1z9ya09vjwBvLUdxEF6Kas85nFJ0Xig25Kuc+FvOupMUk1OqrabLiKZ3LypGN4wxkA6fSYOu7maLRuhOTzrOLfXmAs8Llboaxv8DWoOynavb8xdzVRdQLVQmlYUhQQ4e07LHBBAS3S8Oc2qDIiyc34a+OYbayAXvP22C4s1frDKGTe6B0aO61sP3lI/Z5nizGUvIhGHDr7BHs6MU6lVPNFDA= 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:(13230022)(4636009)(136003)(39860400002)(366004)(346002)(396003)(376002)(451199015)(38100700002)(4326008)(8936002)(31696002)(5660300002)(66556008)(6916009)(44832011)(2906002)(8676002)(66946007)(66476007)(41300700001)(6506007)(6486002)(186003)(26005)(53546011)(2616005)(6512007)(6666004)(86362001)(316002)(478600001)(31686004)(36756003)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VHk2Ykd4L3JGd09QY1V5ajVtT2w0ZFg1eFBvRGVIMXNVcUhHR08vdi8rWVFn?= =?utf-8?B?RHhTbFdsUUsxN0xzNXJ2dVBFM3hXVmFLUVpUbko1Qy92blY5ekp5cVo5QmR5?= =?utf-8?B?QUVNcy9odFYrZUFRNVQ3MnVjL1REZVdFblZIOWF0M0FSUEx2Wk1uMHF1WENm?= =?utf-8?B?aWlJL0ZIbWtqdmtjUllTak5jM1FqcHRGYlg3SHFHY21UU05qbnVnZ3h1YUNu?= =?utf-8?B?dDJ4ZlZIR0dudnhsS0o0ZDRUWEI4NVd1clNsamxuTWdMSXk4UndCVmRyc2dN?= =?utf-8?B?anFWNDRtWFFHZTFZZWpBald4ZEZvZWxyZ3AvNEFJMWl6N250dHMvMmhPOGdF?= =?utf-8?B?bngrUDF0czJ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MS-Exchange-CrossTenant-Network-Message-Id: 81c2b146-a08f-4ede-4cc7-08daf942ca51 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2023 10:57:28.6329 (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: 5HsD3kGaKcWZieV2CcyVgoTyGoulxfZuqG4PZlnP5FhLVmWGUpMNPbaZuw8R5sj3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5620 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 11/22/2022 3:30 PM, okaya@kernel.org wrote: > From: Sinan Kaya > > In rte_pmd_tun_probe result of call to rte_vdev_device_name is > dereferenced here and may be null. > > Signed-off-by: Sinan Kaya > --- > drivers/net/tap/rte_eth_tap.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c > index f2a6c33a19..b99439e4f2 100644 > --- a/drivers/net/tap/rte_eth_tap.c > +++ b/drivers/net/tap/rte_eth_tap.c > @@ -2340,6 +2340,9 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev) > struct rte_eth_dev *eth_dev; > > name = rte_vdev_device_name(dev); > + if (name == NULL) > + return -1; > + > params = rte_vdev_device_args(dev); > memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN); > Yes, technically 'rte_vdev_device_name()' can return NULL, but call stack is like this: ` vdev_probe_all_drivers() //in 'vdev.c' name = rte_vdev_device_name(dev); if (vdev_parse(name, &driver)) return -1; ret = driver->probe(dev); //it is 'rte_pmd_tun_probe()' ` I assume this is highlighted by a tool but in practice 'rte_vdev_device_name()' should not return NULL, and there are many other location this check is missing. Although it doesn't hurt, I think we can skip the check since it is unnecessary.