From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 296691BA5B for ; Fri, 22 Jun 2018 09:24:13 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E12D5BCD2; Fri, 22 Jun 2018 07:24:12 +0000 (UTC) Received: from [10.36.112.42] (ovpn-112-42.ams2.redhat.com [10.36.112.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29C8B1C5AA; Fri, 22 Jun 2018 07:24:10 +0000 (UTC) To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org References: <20180622035305.28412-1-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: Date: Fri, 22 Jun 2018 09:24:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180622035305.28412-1-tiwei.bie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 22 Jun 2018 07:24:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 22 Jun 2018 07:24:12 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH] vhost: fix potential null pointer dereference X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2018 07:24:13 -0000 On 06/22/2018 05:53 AM, Tiwei Bie wrote: > Coverity issue: 293097 > Fixes: d90cf7d111ac ("vhost: support host notifier") > > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/vhost_user.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 26cfebec0..bea6a0428 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1830,6 +1830,8 @@ int vhost_user_host_notifier_ctrl(int vid, bool enable) > return -ENOTSUP; > > vdpa_dev = rte_vdpa_get_device(did); > + if (!vdpa_dev) > + return -ENODEV; > > RTE_FUNC_PTR_OR_ERR_RET(vdpa_dev->ops->get_vfio_device_fd, -ENOTSUP); > RTE_FUNC_PTR_OR_ERR_RET(vdpa_dev->ops->get_notify_area, -ENOTSUP); > Reviewed-by: Maxime Coquelin Thanks, Maxime