This is a note to let you know that I've just added the patch titled rpmsg: glink: Free pending deferred work on remove to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: rpmsg-glink-free-pending-deferred-work-on-remove.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 278bcb7300f61785dba63840bd2a8cf79f14554c Mon Sep 17 00:00:00 2001 From: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> Date: Fri, 4 Oct 2019 15:27:02 -0700 Subject: rpmsg: glink: Free pending deferred work on remove From: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> commit 278bcb7300f61785dba63840bd2a8cf79f14554c upstream. By just cancelling the deferred rx worker during GLINK instance teardown any pending deferred commands are leaked, so free them. Fixes: b4f8e52b89f6 ("rpmsg: Introduce Qualcomm RPM glink driver") Cc: stable@xxxxxxxxxxxxxxx Acked-by: Chris Lew <clew@xxxxxxxxxxxxxx> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@xxxxxxxxxx> Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/rpmsg/qcom_glink_native.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1539,6 +1539,18 @@ static void qcom_glink_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, @@ -1611,7 +1623,7 @@ void qcom_glink_native_remove(struct qco 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) Patches currently in stable-queue which might be from bjorn.andersson@xxxxxxxxxx are queue-4.14/rpmsg-glink-fix-rpmsg_register_device-err-handling.patch queue-4.14/rpmsg-glink-don-t-send-pending-rx_done-during-remove.patch queue-4.14/rpmsg-glink-fix-reuse-intents-memory-leak-issue.patch queue-4.14/rpmsg-glink-set-tail-pointer-to-0-at-end-of-fifo.patch queue-4.14/rpmsg-glink-put-an-extra-reference-during-cleanup.patch queue-4.14/rpmsg-glink-fix-use-after-free-in-open_ack-timeout-case.patch queue-4.14/rpmsg-glink-free-pending-deferred-work-on-remove.patch