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 159A3A056B; Mon, 21 Nov 2022 21:40:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2960542D3A; Mon, 21 Nov 2022 21:40:35 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 1F81E42D30 for ; Mon, 21 Nov 2022 21:40:33 +0100 (CET) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 98F9961458 for ; Mon, 21 Nov 2022 20:40:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1B36C433C1; Mon, 21 Nov 2022 20:40:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669063232; bh=LY5cXO754AO/wuwLzCnfYwK2O6npgtMNjj5OeL1qiOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pI0igQo9lAOk4RXvIlv2mtyMvABhFfGnnT6FdxVy9/fvEPQplGTUF+eN3wqzoz0PO WTMZnGjs8yeke5wpZBQQPqnfxYptJaiBMg2brxqCepssMNMdbnuBzmASfUJZ7LxmUG rmaTpYd49vicl96KrCykFO5MIAoXf1wE5os88HaJwms8kz4kcvXUN1qBLkkUk/5Em2 7k/Q0rbOAdFyYDfb8sll3VTfZbC+dsP8SlNYsgHeHHeMa78E3/M3L2iM8s/ZH8By7+ 1GlX+qFT/e+OHmjTExntn5PSGbOYfxBYSJ/IiQva1ImrQaRWzSpjJ17Qtk6g88qJum ZrqbKoODRM4wQ== From: okaya@kernel.org To: dev@dpdk.org Cc: Sinan Kaya Subject: [PATCH 02/11] net/tap: check if name is null Date: Mon, 21 Nov 2022 15:40:08 -0500 Message-Id: <20221121204015.1135573-3-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221121204015.1135573-1-okaya@kernel.org> References: <20221121204015.1135573-1-okaya@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index f2a6c33a19..aa640f8acc 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -2340,6 +2340,10 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev) struct rte_eth_dev *eth_dev; name = rte_vdev_device_name(dev); + if (!name) { + return -1; + } + params = rte_vdev_device_args(dev); memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN); -- 2.25.1