diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-02-04 17:10:05 +0300 |
---|---|---|
committer | Li Yang <leoyang.li@nxp.com> | 2019-02-04 14:58:49 -0600 |
commit | c1959066ac02bd123201352ff5a8c506469a1645 (patch) | |
tree | 7c0fb14ecf94c4c233878effcaea1aaf6b280a62 /drivers/soc/fsl | |
parent | 3c0d64e867ed78a782a8a00d3b519396d9c5a2db (diff) | |
download | linux-c1959066ac02bd123201352ff5a8c506469a1645.tar.gz linux-c1959066ac02bd123201352ff5a8c506469a1645.tar.bz2 linux-c1959066ac02bd123201352ff5a8c506469a1645.zip |
soc: fsl: dpio: Use after free in dpaa2_dpio_remove()
The dpaa2_io_down(priv->io) call frees "priv->io" so I've shifted the
code around a little bit to avoid the use after free.
Fixes: 991e873223e9 ("soc: fsl: dpio: use a cpumask to identify which cpus are unused")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/soc/fsl')
-rw-r--r-- | drivers/soc/fsl/dpio/dpio-driver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c index 2d4af32a0dec..a28799b62d53 100644 --- a/drivers/soc/fsl/dpio/dpio-driver.c +++ b/drivers/soc/fsl/dpio/dpio-driver.c @@ -220,12 +220,12 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) dev = &dpio_dev->dev; priv = dev_get_drvdata(dev); + cpu = dpaa2_io_get_cpu(priv->io); dpaa2_io_down(priv->io); dpio_teardown_irqs(dpio_dev); - cpu = dpaa2_io_get_cpu(priv->io); cpumask_set_cpu(cpu, cpus_unused_mask); err = dpio_open(dpio_dev->mc_io, 0, dpio_dev->obj_desc.id, |