1
0
Fork 0

MLK-24084-1: ASoc: fsl_asrc_m2m: Fix kernel panic in m2m stress test

initilize the m2m->complete in open() to avoid the NULL pointer in suspend
because the suspend can be called before initilizing m2m->complete in convert

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Shengjiu Wang 2020-05-20 19:31:41 +08:00
parent 40a1d40b49
commit 857284dc23
1 changed files with 4 additions and 2 deletions

View File

@ -709,8 +709,8 @@ static long fsl_asrc_ioctl_convert(struct fsl_asrc_pair *pair,
return ret;
}
init_completion(&m2m->complete[IN]);
init_completion(&m2m->complete[OUT]);
reinit_completion(&m2m->complete[IN]);
reinit_completion(&m2m->complete[OUT]);
#ifdef ASRC_POLLING_WITHOUT_DMA
fsl_asrc_polling_debug(pair);
@ -897,6 +897,8 @@ static int fsl_asrc_open(struct inode *inode, struct file *file)
pair->asrc_priv = asrc_priv;
spin_lock_init(&m2m->lock);
init_completion(&m2m->complete[IN]);
init_completion(&m2m->complete[OUT]);
file->private_data = pair;