Skip to content

Commit 68e6134

Browse files
committed
Merge tag 'rpmsg-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull rpmsg updates from Bjorn Andersson: "This corrects the check for irq_of_parse_and_map() failures in the Qualcomm SMD driver and fixes unregistration and a couple of double free in the virtio rpmsg driver" * tag 'rpmsg-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: qcom_smd: Fix returning 0 if irq_of_parse_and_map() fails rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl rpmsg: virtio: Fix possible double free in rpmsg_virtio_add_ctrl_dev() rpmsg: virtio: Fix possible double free in rpmsg_probe() rpmsg: qcom_smd: Fix irq_of_parse_and_map() return value
2 parents f634b63 + 59d6f72 commit 68e6134

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

drivers/rpmsg/qcom_smd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,9 @@ static int qcom_smd_parse_edge(struct device *dev,
14071407
edge->name = node->name;
14081408

14091409
irq = irq_of_parse_and_map(node, 0);
1410-
if (irq < 0) {
1410+
if (!irq) {
14111411
dev_err(dev, "required smd interrupt missing\n");
1412-
ret = irq;
1412+
ret = -EINVAL;
14131413
goto put_node;
14141414
}
14151415

drivers/rpmsg/virtio_rpmsg_bus.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev
851851

852852
err = rpmsg_ctrldev_register_device(rpdev_ctrl);
853853
if (err) {
854-
kfree(vch);
854+
/* vch will be free in virtio_rpmsg_release_device() */
855855
return ERR_PTR(err);
856856
}
857857

@@ -862,7 +862,7 @@ static void rpmsg_virtio_del_ctrl_dev(struct rpmsg_device *rpdev_ctrl)
862862
{
863863
if (!rpdev_ctrl)
864864
return;
865-
kfree(to_virtio_rpmsg_channel(rpdev_ctrl));
865+
device_unregister(&rpdev_ctrl->dev);
866866
}
867867

868868
static int rpmsg_probe(struct virtio_device *vdev)
@@ -973,7 +973,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
973973

974974
err = rpmsg_ns_register_device(rpdev_ns);
975975
if (err)
976-
goto free_vch;
976+
/* vch will be free in virtio_rpmsg_release_device() */
977+
goto free_ctrldev;
977978
}
978979

979980
/*
@@ -997,8 +998,6 @@ static int rpmsg_probe(struct virtio_device *vdev)
997998

998999
return 0;
9991000

1000-
free_vch:
1001-
kfree(vch);
10021001
free_ctrldev:
10031002
rpmsg_virtio_del_ctrl_dev(rpdev_ctrl);
10041003
free_coherent:

0 commit comments

Comments
 (0)