mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 16:17:41 -04:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user