From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CB57A052B for ; Tue, 28 Jul 2020 10:41:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 29E8D1C0B5; Tue, 28 Jul 2020 10:41:14 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id E4E9E1C0B5 for ; Tue, 28 Jul 2020 10:41:12 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AB7661A0CE2; Tue, 28 Jul 2020 10:41:12 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5A40C1A0062; Tue, 28 Jul 2020 10:41:10 +0200 (CEST) Received: from lsv03196.swis.in-blr01.nxp.com (lsv03196.swis.in-blr01.nxp.com [92.120.146.192]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 45C24402AA; Tue, 28 Jul 2020 10:41:07 +0200 (CEST) From: rohit.raj@nxp.com To: akhil.goyal@nxp.com, hemant.agrawal@nxp.com Cc: rohit.raj@nxp.com, nipun.gupta@nxp.com, stable@dpdk.org Date: Tue, 28 Jul 2020 14:11:07 +0530 Message-Id: <20200728084107.16956-1-rohit.raj@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-stable] [PATCH] bus/fslmc: fix dpio close X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Rohit Raj The current state of the DPIO object should be checked before trying to close/disable the object. Fixes: 293c0ca94c36 ("bus/fslmc: support memory backed portals with QBMAN 5.0") Cc: stable@dpdk.org Signed-off-by: Rohit Raj --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index be7e31a7c7..6428d4bb86 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -558,8 +558,13 @@ dpaa2_create_dpio_device(int vdev_fd, err: if (dpio_dev->dpio) { - dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); - dpio_close(dpio_dev->dpio, CMD_PRI_LOW, dpio_dev->token); + if (dpio_dev->token) { + dpio_disable(dpio_dev->dpio, CMD_PRI_LOW, + dpio_dev->token); + dpio_close(dpio_dev->dpio, CMD_PRI_LOW, + dpio_dev->token); + } + rte_free(dpio_dev->eqresp); rte_free(dpio_dev->dpio); } -- 2.17.1