Commit e181a569 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Li Yang

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: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: default avatarLi Yang <leoyang.li@nxp.com>
parent bfeffd15
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment