From patchwork Tue Jul 28 16:24:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rohit Raj X-Patchwork-Id: 74940 X-Patchwork-Delegate: thomas@monjalon.net 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 88032A052B; Tue, 28 Jul 2020 18:25:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A23B2B8D; Tue, 28 Jul 2020 18:25:08 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 3F86110A3; Tue, 28 Jul 2020 18:25:06 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1A0151A17F3; Tue, 28 Jul 2020 18:25:06 +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 AD4A61A0E8D; Tue, 28 Jul 2020 18:25:03 +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 9A464402C4; Tue, 28 Jul 2020 18:25:00 +0200 (CEST) From: rohit.raj@nxp.com To: Hemant Agrawal , Sachin Saxena Cc: dev@dpdk.org, stable@dpdk.org, Rohit Raj Date: Tue, 28 Jul 2020 21:54:59 +0530 Message-Id: <20200728162459.990-1-rohit.raj@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1] bus/fslmc: fix dpio close 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: 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 Acked-by: Sachin Saxena --- 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 97be76116..b0055b164 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -528,8 +528,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); }