linux-stable/drivers/rpmsg
Matthias Kaehlcke d249b89621 rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev
commit 7a534ae89e upstream.

struct rpmsg_eptdev contains a struct cdev. The current code frees
the rpmsg_eptdev struct in rpmsg_eptdev_destroy(), but the cdev is
a managed object, therefore its release is not predictable and the
rpmsg_eptdev could be freed before the cdev is entirely released.

The cdev_device_add/del() API was created to address this issue
(see commit '233ed09d7fda ("chardev: add helper function to register
char devs with a struct device")'), use it instead of cdev add/del().

Fixes: c0cdc19f84 ("rpmsg: Driver for user space endpoint interface")
Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220110104706.v6.2.Idde68b05b88d4a2e6e54766c653f3a6d9e419ce6@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:16:25 +01:00
..
Kconfig
Makefile
qcom_glink_native.c rpmsg: qcom_glink_native: fix error return code of qcom_glink_rx_data() 2021-05-22 10:57:38 +02:00
qcom_glink_native.h
qcom_glink_rpm.c
qcom_glink_smem.c rpmsg: glink: smem: Ensure ordering during tx 2020-04-24 08:01:06 +02:00
qcom_smd.c rpmsg: smd: fix memory leak on channel create 2018-11-13 11:15:12 -08:00
rpmsg_char.c rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev 2022-02-08 18:16:25 +01:00
rpmsg_core.c
rpmsg_internal.h
virtio_rpmsg_bus.c