提交 7438617d 编写于 作者: B Bjorn Andersson 提交者: Greg Kroah-Hartman

rpmsg: glink: Free pending deferred work on remove

commit 278bcb7300f61785dba63840bd2a8cf79f14554c upstream.

By just cancelling the deferred rx worker during GLINK instance teardown
any pending deferred commands are leaked, so free them.

Fixes: b4f8e52b ("rpmsg: Introduce Qualcomm RPM glink driver")
Cc: stable@vger.kernel.org
Acked-by: NChris Lew <clew@codeaurora.org>
Tested-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6f482295
......@@ -1565,6 +1565,18 @@ static void qcom_glink_work(struct work_struct *work)
}
}
static void qcom_glink_cancel_rx_work(struct qcom_glink *glink)
{
struct glink_defer_cmd *dcmd;
struct glink_defer_cmd *tmp;
/* cancel any pending deferred rx_work */
cancel_work_sync(&glink->rx_work);
list_for_each_entry_safe(dcmd, tmp, &glink->rx_queue, node)
kfree(dcmd);
}
struct qcom_glink *qcom_glink_native_probe(struct device *dev,
unsigned long features,
struct qcom_glink_pipe *rx,
......@@ -1642,7 +1654,7 @@ void qcom_glink_native_remove(struct qcom_glink *glink)
int ret;
disable_irq(glink->irq);
cancel_work_sync(&glink->rx_work);
qcom_glink_cancel_rx_work(glink);
ret = device_for_each_child(glink->dev, NULL, qcom_glink_remove_device);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册