LF-3548-1: ASoC: fsl_asrc_m2m: Fix issue with double kfree
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 12 May 2021 09:59:50 +0000 (17:59 +0800)
committerShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 12 May 2021 10:43:20 +0000 (18:43 +0800)
The pointer need to be NULL after kfree to avoid kernel dummp
in second kfree for same pointer.

[ 9285.401707] Call trace:
[ 9285.404171]  kfree+0x388/0x3fc
[ 9285.407238]  fsl_easrc_ioctl+0xf4/0xf80

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Peng Zhang <peng.zhang_8@nxp.com>
sound/soc/fsl/fsl_asrc_m2m.c

index 411f132..26f6396 100644 (file)
@@ -151,7 +151,7 @@ static int fsl_allocate_dma_buf(struct fsl_asrc_pair *pair)
 
 exit:
        kfree(input->dma_vaddr);
-
+       input->dma_vaddr = NULL;
        return -ENOMEM;
 }