From 0e066fbe479a27daea1027155ddde1f94718aa2d Mon Sep 17 00:00:00 2001 From: Sudheer Papothi Date: Fri, 16 Sep 2016 23:25:25 +0530 Subject: [PATCH] ASoC: wsa881x: Avoid removing of already deleted timer object Cancel_delayed_work_sync in wsa881x_swr_down function is trying to remove the timer object which is already deleted. Check for pending work before calling cancel_delayed_work_sync to avoid unnecessary removal of timer object which is already deleted. CRs-Fixed: 1065347 Change-Id: I2d173d05642c58451d56d84d9e34ae65a00c1e3c Signed-off-by: Sudheer Papothi --- sound/soc/codecs/wsa881x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index b97b73dc4191..6194b818d4c9 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1305,7 +1305,8 @@ static int wsa881x_swr_down(struct swr_device *pdev) dev_err(&pdev->dev, "%s: wsa881x is NULL\n", __func__); return -EINVAL; } - cancel_delayed_work_sync(&wsa881x->ocp_ctl_work); + if (delayed_work_pending(&wsa881x->ocp_ctl_work)) + cancel_delayed_work_sync(&wsa881x->ocp_ctl_work); ret = wsa881x_gpio_ctrl(wsa881x, false); if (ret) dev_err(&pdev->dev, "%s: Failed to disable gpio\n", __func__);