diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-05-20 19:31:41 +0800 |
---|---|---|
committer | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-05-21 18:45:35 +0800 |
commit | 857284dc23fb2bcd6216ddc8e254c5133f449801 (patch) | |
tree | 240cc17486bbb9c9cfb211645a3b6bac1bec3528 | |
parent | 40a1d40b498fb9bf4666615776dcbc5fcd3e05e6 (diff) |
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>
-rw-r--r-- | sound/soc/fsl/fsl_asrc_m2m.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index 406d513ee1cf..06d653a1757a 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -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; |