From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B4B0D4C96; Fri, 9 Nov 2018 12:38:55 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1DC78C049E12; Fri, 9 Nov 2018 11:38:55 +0000 (UTC) Received: from [10.36.112.39] (ovpn-112-39.ams2.redhat.com [10.36.112.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8333E608C1; Fri, 9 Nov 2018 11:38:53 +0000 (UTC) To: Tiwei Bie , zhihong.wang@intel.com, dev@dpdk.org Cc: stable@dpdk.org References: <20181107090102.9364-1-tiwei.bie@intel.com> <20181107090102.9364-3-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: <2f09fe91-5c55-735b-277d-32c43c6fb7ee@redhat.com> Date: Fri, 9 Nov 2018 12:38:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181107090102.9364-3-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.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 09 Nov 2018 11:38:55 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 2/2] vhost: remove unneeded null pointer check 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, 09 Nov 2018 11:38:56 -0000 On 11/7/18 10:01 AM, Tiwei Bie wrote: > The caller will guarantee that msg won't be null. Remove > the unneeded null pointer check which caused a Coverity > warning. > > Coverity issue: 323484 > Fixes: 8f972312b8f4 ("vhost: support vhost-user") > Cc: stable@dpdk.org > > Signed-off-by: Tiwei Bie > --- > lib/librte_vhost/vhost_user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index cc154f312..3ea64eba6 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1732,7 +1732,7 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg) > if (ret <= 0) > return ret; > > - if (msg && msg->size) { > + if (msg->size) { > if (msg->size > sizeof(msg->payload)) { > RTE_LOG(ERR, VHOST_CONFIG, > "invalid msg size: %d\n", msg->size); > Reviewed-by: Maxime Coquelin Thanks, Maxime