rpmsg updates for v5.19

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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEBd4DzF816k8JZtUlCx85Pw2ZrcUFAmKXWeUbHGJqb3JuLmFu
 ZGVyc3NvbkBsaW5hcm8ub3JnAAoJEAsfOT8Nma3FG0kQAMv+Vu8jO8rdLkl+RsUS
 zCVSGBPWU75pfmDeOPTZSzKAfL5nXwLO9zqS6cWaLdiRknrQ2YnOFUxu48Y+Lwt4
 XkpfQmE7FuZlsKyOikvgmzFxXmPonOunVeGbOP6HCGturLU8WgR5pK8SfXMalC8X
 /GMBdPvIQIIL04Gklko59Q8tzgUK+u2Krp+YN9uVkSoxM/gOdvpk0YkwEHoCyxhd
 0P54KWPwwUR8z305nuH0iDtGdh1sXCf/S9QGMQggOFW6vdwiKU2vUQCifvAHXTOR
 dOSt4O1lDumm2UXMTlsbNesCqdAAqYjFfvwZhW9/21NeNxJU0D1I1Mo/EcrEiYmO
 s3Tkcy4Njh01SlL9us4wwBhzfLz6YdCNtk6nl7m9OKHVMlJysuL0c+ff+mcmywVT
 BaJrpHDE6f+mvJVe/KzshzAUih1BZcmZsJh/OtQYLpz+cY9nZdMkaKOl3cjxcFn1
 sL22HhE1UgsBt6EYX+EFyRWr8TpRdVj5p9OD20RJ6cj181LyK6RSBu6ryT6QneTt
 9Cui7tI1q+0tf1KPMrWvlBEPPcw1VWI0N2mfZfhGxu/UjZxgY8IhWW8zLBAg2VCm
 wJTm2Y6wSfvndr7W4zo8gMBH5fsZusPta/UtmrAcgmbMtiAzxo2GX3/pMY5Gpalw
 4c2tcwaquztx5IAv356WIL6O
 =N17f
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2022-06-01 10:39:58 -07:00
commit 68e6134bb7
2 changed files with 6 additions and 7 deletions

View File

@ -1407,9 +1407,9 @@ static int qcom_smd_parse_edge(struct device *dev,
edge->name = node->name;
irq = irq_of_parse_and_map(node, 0);
if (irq < 0) {
if (!irq) {
dev_err(dev, "required smd interrupt missing\n");
ret = irq;
ret = -EINVAL;
goto put_node;
}

View File

@ -851,7 +851,7 @@ static struct rpmsg_device *rpmsg_virtio_add_ctrl_dev(struct virtio_device *vdev
err = rpmsg_ctrldev_register_device(rpdev_ctrl);
if (err) {
kfree(vch);
/* vch will be free in virtio_rpmsg_release_device() */
return ERR_PTR(err);
}
@ -862,7 +862,7 @@ static void rpmsg_virtio_del_ctrl_dev(struct rpmsg_device *rpdev_ctrl)
{
if (!rpdev_ctrl)
return;
kfree(to_virtio_rpmsg_channel(rpdev_ctrl));
device_unregister(&rpdev_ctrl->dev);
}
static int rpmsg_probe(struct virtio_device *vdev)
@ -973,7 +973,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
err = rpmsg_ns_register_device(rpdev_ns);
if (err)
goto free_vch;
/* vch will be free in virtio_rpmsg_release_device() */
goto free_ctrldev;
}
/*
@ -997,8 +998,6 @@ static int rpmsg_probe(struct virtio_device *vdev)
return 0;
free_vch:
kfree(vch);
free_ctrldev:
rpmsg_virtio_del_ctrl_dev(rpdev_ctrl);
free_coherent: