From patchwork Mon Jul 27 14:03:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunjian Wang X-Patchwork-Id: 74853 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C2863A053A; Mon, 27 Jul 2020 16:03:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 547B31BFD9; Mon, 27 Jul 2020 16:03:50 +0200 (CEST) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 3740A1BFBA; Mon, 27 Jul 2020 16:03:48 +0200 (CEST) Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9ADAD105FF839C087868; Mon, 27 Jul 2020 22:03:46 +0800 (CST) Received: from localhost (10.174.185.168) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Mon, 27 Jul 2020 22:03:38 +0800 From: wangyunjian To: , CC: , , Yunjian Wang , Date: Mon, 27 Jul 2020 22:03:14 +0800 Message-ID: X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.174.185.168] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] eventdev: fix return value of null not checked X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: Yunjian Wang The function rte_zmalloc() could return NULL, the return value need to be checked. Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Reviewed-by: Nikhil Rao --- lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c index bb21dc407..86287b4e6 100644 --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c @@ -734,6 +734,8 @@ txa_service_queue_add(uint8_t id, qdone = rte_zmalloc(txa->mem_name, nb_queues * sizeof(*qdone), 0); + if (qdone == NULL) + return -ENOMEM; j = 0; for (i = 0; i < nb_queues; i++) { if (txa_service_is_queue_added(txa, eth_dev, i))