summaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg/virtio_rpmsg_bus.c
diff options
context:
space:
mode:
authorHenri Roosen <henri.roosen@ginzinger.com>2017-06-02 13:35:51 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-06-25 14:35:02 -0700
commitb2599ebffb2d32e051669c0a94f8e363ad7a2e8b (patch)
treecf5c2a60d6b6e32367fe1d1c878bf778e0c73df5 /drivers/rpmsg/virtio_rpmsg_bus.c
parentb4f8e52b89f69f5563ac4cb9ffdacc4418917af1 (diff)
downloadlinux-b2599ebffb2d32e051669c0a94f8e363ad7a2e8b.tar.bz2
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: Henri Roosen <henri.roosen@ginzinger.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/virtio_rpmsg_bus.c')
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 4848da89431f..6ec73c6ab4b1 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -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;