* [dpdk-stable] [PATCH] bus/fslmc: fix dpio close
@ 2020-07-28 8:41 rohit.raj
0 siblings, 0 replies; only message in thread
From: rohit.raj @ 2020-07-28 8:41 UTC (permalink / raw)
To: akhil.goyal, hemant.agrawal; +Cc: rohit.raj, nipun.gupta, stable
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-07-28 8:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 8:41 [dpdk-stable] [PATCH] bus/fslmc: fix dpio close rohit.raj
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).