From: Rohit Raj Date: Tue, 28 Jul 2020 16:24:59 +0000 (+0530) Subject: bus/fslmc: fix dpio close X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ba156cdf70f20ec5321592fe4595ab8f9ae343ec;p=dpdk.git bus/fslmc: fix dpio close 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 --- diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 97be761164..b0055b1644 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); }