DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>, zhihong.wang@intel.com, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] vhost: remove unneeded null pointer check
Date: Fri, 9 Nov 2018 12:38:51 +0100	[thread overview]
Message-ID: <2f09fe91-5c55-735b-277d-32c43c6fb7ee@redhat.com> (raw)
In-Reply-To: <20181107090102.9364-3-tiwei.bie@intel.com>



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 <tiwei.bie@intel.com>
> ---
>   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 <maxime.coquelin@redhat.com>

Thanks,
Maxime

  reply	other threads:[~2018-11-09 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07  9:01 [dpdk-dev] [PATCH 0/2] Fix Coverity issues for virtio-pci and vhost-user msg Tiwei Bie
2018-11-07  9:01 ` [dpdk-dev] [PATCH 1/2] net/virtio: fix unchecked return value Tiwei Bie
2018-11-09 11:38   ` Maxime Coquelin
2018-11-07  9:01 ` [dpdk-dev] [PATCH 2/2] vhost: remove unneeded null pointer check Tiwei Bie
2018-11-09 11:38   ` Maxime Coquelin [this message]
2018-11-09 14:52 ` [dpdk-dev] [PATCH 0/2] Fix Coverity issues for virtio-pci and vhost-user msg Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f09fe91-5c55-735b-277d-32c43c6fb7ee@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).