summaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl/dpio/dpio-service.c
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2018-12-04 12:20:27 +0100
committerLi Yang <leoyang.li@nxp.com>2019-01-08 21:15:36 +0100
commite181a569d8e52d5a5c91cf2ddc3ebcfb81163887 (patch)
treea7787d8d5a4e5e03a11aa6904ac0a468e686d896 /drivers/soc/fsl/dpio/dpio-service.c
parentLinux 5.0-rc1 (diff)
downloadlinux-e181a569d8e52d5a5c91cf2ddc3ebcfb81163887.tar.xz
linux-e181a569d8e52d5a5c91cf2ddc3ebcfb81163887.zip
soc: fsl: dpio: cleanup the cpu array on dpaa2_io_down
The dpio_by_cpu array should not contain a reference to a freed dpaa2_io object. This patch adds the necessary cleanup in dpaa2_io_down. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/soc/fsl/dpio/dpio-service.c')
-rw-r--r--drivers/soc/fsl/dpio/dpio-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c
index ec0837ff039a..ab046f241d32 100644
--- a/drivers/soc/fsl/dpio/dpio-service.c
+++ b/drivers/soc/fsl/dpio/dpio-service.c
@@ -160,6 +160,11 @@ struct dpaa2_io *dpaa2_io_create(const struct dpaa2_io_desc *desc)
*/
void dpaa2_io_down(struct dpaa2_io *d)
{
+ spin_lock(&dpio_list_lock);
+ dpio_by_cpu[d->dpio_desc.cpu] = NULL;
+ list_del(&d->node);
+ spin_unlock(&dpio_list_lock);
+
kfree(d);
}