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 DD4DBA056D; Mon, 21 Nov 2022 23:32:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF4A042D40; Mon, 21 Nov 2022 23:32:18 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mails.dpdk.org (Postfix) with ESMTP id 88B9140DF6 for ; Mon, 21 Nov 2022 23:32:16 +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 0EDEE612E6 for ; Mon, 21 Nov 2022 22:32:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 625DCC433B5; Mon, 21 Nov 2022 22:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669069935; bh=nDkxEv2/TwAeupXyQuSPUNIGA1QSVTVAI7IEmhVnCt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJWjVVE6dlJ8Y7Oj3rUGDNNbYQPLLg+ew3feN1TYgGYTKRZo+Yw8FjDscIwDh20zJ UimaeHiYEWPfknYi4cikCp5jvsx+HNjFy7UWmJiJNQtLUHXHGE41LbDTD/5v01GLf5 ZzG/i9qL64bj2gHMSRR8XU8n+NbuUGDIzsvhOiDOQPLxsFip3he0fkP8jmtPb230CR iQjn1hBI2rVTdd/JriQyjg8MIDrX+pDvkHt5u/L1BoOq2JserE5ExqPW4Og6Ca1PAd s2RS+AXTk2yeIrQJbZbzgoClGFrFj8sfYvMicJmaZRnsyboyAgTLb/c2sDFVkmOMPm m3RLOb8PtTX7g== From: okaya@kernel.org To: dev@dpdk.org Cc: Sinan Kaya Subject: [PATCH v2 02/11] net/tap: check if name is null Date: Mon, 21 Nov 2022 17:32:01 -0500 Message-Id: <20221121223208.1147154-3-okaya@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221121223208.1147154-1-okaya@kernel.org> References: <20221121223208.1147154-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 | 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); -- 2.25.1