diff options
author | Shengjiu Wang <shengjiu.wang@nxp.com> | 2020-04-25 15:19:29 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-04-27 14:08:43 +0100 |
commit | f3fc1ea011f09156886e8f4beb240ea814f2197a (patch) | |
tree | 1ab7d59c6a8af047b8d66ae473e4b10cb7c29e44 /mm/page_poison.c | |
parent | 1597bfbfdb3c6e97ad0f63abedc2a26d6c1850c7 (diff) | |
download | linux-stable-f3fc1ea011f09156886e8f4beb240ea814f2197a.tar.gz linux-stable-f3fc1ea011f09156886e8f4beb240ea814f2197a.tar.bz2 linux-stable-f3fc1ea011f09156886e8f4beb240ea814f2197a.zip |
ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()
The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI
drivers" from Apr 16, 2020, leads to the following Smatch complaint:
sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free()
warn: variable dereferenced before check 'ctx' (see line 1527)
sound/soc/fsl/fsl_easrc.c
1526 struct fsl_asrc_pair *ctx = runtime->private_data;
1527 struct fsl_easrc_ctx_priv *ctx_priv = ctx->private;
^^^^^
Dereference
1528
1529 if (ctx && (ctx_priv->ctx_streams & BIT(substream->stream))) {
^^^
This check is too late, to prevent a NULL dereference.
1530 ctx_priv->ctx_streams &= ~BIT(substream->stream);
1531 fsl_easrc_release_context(ctx);
Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Link: https://lore.kernel.org/r/d23c939f1c9eeb3fce34b6c34d44e2d6156f663a.1587799355.git.shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'mm/page_poison.c')
0 files changed, 0 insertions, 0 deletions