bus/fslmc: fix dpio close

The current state of the DPIO object should be checked
before trying to close/disable the object.

Fixes: 293c0ca94c ("bus/fslmc: support memory backed portals with QBMAN 5.0")
Cc: stable@dpdk.org

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Sachin Saxena <sachin.saxena@oss.nxp.com>
This commit is contained in:
Rohit Raj 2020-07-28 21:54:59 +05:30 committed by Thomas Monjalon
parent 6ee0c53fda
commit ba156cdf70

View File

@ -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);
}