[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1466631652-25731-10-git-send-email-stuart.yoder@nxp.com>
Date: Wed, 22 Jun 2016 16:40:50 -0500
From: Stuart Yoder <stuart.yoder@....com>
To: <gregkh@...uxfoundation.org>
CC: <german.rivera@....com>, <devel@...verdev.osuosl.org>,
<linux-kernel@...r.kernel.org>, <agraf@...e.de>, <arnd@...db.de>,
<leoyang.li@....com>, Stuart Yoder <stuart.yoder@....com>
Subject: [PATCH 09/11] staging: fsl-mc: dprc: fix ordering problem freeing resources in remove of dprc
When unbinding a dprc from the dprc driver the cleanup of
the resource pools must happen after irq pool cleanup
is done.
Signed-off-by: Stuart Yoder <stuart.yoder@....com>
---
drivers/staging/fsl-mc/bus/dprc-driver.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
index 96ee1b7..d2a71f1 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -796,16 +796,18 @@ static int dprc_remove(struct fsl_mc_device *mc_dev)
dprc_teardown_irq(mc_dev);
device_for_each_child(&mc_dev->dev, NULL, __fsl_mc_device_remove);
- dprc_cleanup_all_resource_pools(mc_dev);
- error = dprc_close(mc_dev->mc_io, 0, mc_dev->mc_handle);
- if (error < 0)
- dev_err(&mc_dev->dev, "dprc_close() failed: %d\n", error);
if (dev_get_msi_domain(&mc_dev->dev)) {
fsl_mc_cleanup_irq_pool(mc_bus);
dev_set_msi_domain(&mc_dev->dev, NULL);
}
+ dprc_cleanup_all_resource_pools(mc_dev);
+
+ error = dprc_close(mc_dev->mc_io, 0, mc_dev->mc_handle);
+ if (error < 0)
+ dev_err(&mc_dev->dev, "dprc_close() failed: %d\n", error);
+
if (!fsl_mc_is_root_dprc(&mc_dev->dev)) {
fsl_destroy_mc_io(mc_dev->mc_io);
mc_dev->mc_io = NULL;
--
1.9.0
Powered by blists - more mailing lists