From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402AbdFYVff (ORCPT ); Sun, 25 Jun 2017 17:35:35 -0400 Received: from mail-pg0-f43.google.com ([74.125.83.43]:36402 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751343AbdFYVfd (ORCPT ); Sun, 25 Jun 2017 17:35:33 -0400 Date: Sun, 25 Jun 2017 14:35:29 -0700 From: Bjorn Andersson To: Henri Roosen Cc: linux-remoteproc@vger.kernel.org, Ohad Ben-Cohen , open list Subject: Re: [PATCH] rpmsg: virtio_rpmsg_bus: fix announce for devices without endpoint Message-ID: <20170625213529.GF26155@builder> References: <1496403351-32280-1-git-send-email-henri.roosen@ginzinger.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1496403351-32280-1-git-send-email-henri.roosen@ginzinger.com> User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 02 Jun 04:35 PDT 2017, Henri Roosen wrote: > A device might not have an endpoint assigned. This patch checks if > rpdev->ept has a value before dereferencing or using it. > Applied, thanks. > Signed-off-by: Henri Roosen > --- > drivers/rpmsg/virtio_rpmsg_bus.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c > index 5e66e081..3c582f2 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; > > -- > 2.1.4 >