Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2599ebf authored by Henri Roosen's avatar Henri Roosen Committed by Bjorn Andersson
Browse files

rpmsg: virtio_rpmsg_bus: fix announce for devices without endpoint



A device might not have an endpoint assigned. This patch checks if
rpdev->ept has a value before dereferencing or using it.

Signed-off-by: default avatarHenri Roosen <henri.roosen@ginzinger.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent b4f8e52b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ static int virtio_rpmsg_announce_create(struct rpmsg_device *rpdev)
	int err = 0;

	/* need to tell remote processor's name service about this channel ? */
	if (rpdev->announce &&
	if (rpdev->announce && rpdev->ept &&
	    virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {
		struct rpmsg_ns_msg nsm;

@@ -338,7 +338,7 @@ static int virtio_rpmsg_announce_destroy(struct rpmsg_device *rpdev)
	int err = 0;

	/* tell remote processor's name service we're removing this channel */
	if (rpdev->announce &&
	if (rpdev->announce && rpdev->ept &&
	    virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {
		struct rpmsg_ns_msg nsm;