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 <spapothi@codeaurora.org>
This commit is contained in:
Sudheer Papothi 2016-09-16 23:25:25 +05:30
parent 6c104f8d40
commit 0e066fbe47

View file

@ -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__);