]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: common: handle NULL case in suspend/resume function
authorTrevor Wu <trevor.wu@mediatek.com>
Fri, 10 Sep 2021 09:26:13 +0000 (17:26 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 10 Sep 2021 14:08:26 +0000 (15:08 +0100)
commitecae17bcbf36bd0c853449eb4f865a369f2e9580
treebe4c26c17897aea0296efa5a46b7eea6f1b0ddf8
parent9edf9d160e7c934b25941e73588fc46ce592ff6c
ASoC: mediatek: common: handle NULL case in suspend/resume function

When memory allocation for afe->reg_back_up fails, reg_back_up can't
be used.
Keep the suspend/resume flow but skip register backup when
afe->reg_back_up is NULL, in case illegal memory access happens.

Fixes: e6f1913974da ("ASoC: mediatek: implement mediatek common structure")
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210910092613.30188-1-trevor.wu@mediatek.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/common/mtk-afe-fe-dai.c