Commit fa1b8591 authored by Bjorn Andersson's avatar Bjorn Andersson

rpmsg: Don't overwrite release op of rpdev

b0b03b81 ("rpmsg: Release rpmsg devices in backends") attempted to
correct the ownership of freeing rpmsg device memory. But the patch
is not complete, in that the rpmsg core will overwrite the release op as
the device is being registered.

Fixes: b0b03b81 ("rpmsg: Release rpmsg devices in backends")
Reported-by: default avatarHenri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent fcd02384
......@@ -461,13 +461,6 @@ static struct bus_type rpmsg_bus = {
.remove = rpmsg_dev_remove,
};
static void rpmsg_release_device(struct device *dev)
{
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
kfree(rpdev);
}
int rpmsg_register_device(struct rpmsg_device *rpdev)
{
struct device *dev = &rpdev->dev;
......@@ -477,7 +470,6 @@ int rpmsg_register_device(struct rpmsg_device *rpdev)
rpdev->id.name, rpdev->src, rpdev->dst);
rpdev->dev.bus = &rpmsg_bus;
rpdev->dev.release = rpmsg_release_device;
ret = device_register(&rpdev->dev);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment