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
Subject: [dpdk-stable] [PATCH] bus/fslmc: fix dpio close
Date: Tue, 28 Jul 2020 14:11:07 +0530 [thread overview]
Message-ID: <20200728084107.16956-1-rohit.raj@nxp.com> (raw)
From: Rohit Raj <rohit.raj@nxp.com>
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 <rohit.raj@nxp.com>
---
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
reply other threads:[~2020-07-28 8:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200728084107.16956-1-rohit.raj@nxp.com \
--to=rohit.raj@nxp.com \
--cc=akhil.goyal@nxp.com \
--cc=hemant.agrawal@nxp.com \
--cc=nipun.gupta@nxp.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).