public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Tiwei Bie <tiwei.bie@intel.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org
Subject: Coverity: vhost_vdpa_open(): Control flow issues
Date: Mon, 13 Apr 2020 09:19:28 -0700	[thread overview]
Message-ID: <202004130919.C9D96730@keescook> (raw)

Hello!

This is an experimental automated report about issues detected by Coverity
from a scan of next-20200413 as part of the linux-next weekly scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Thu Mar 26 22:01:23 2020 +0800
    4c8cf31885f6 ("vhost: introduce vDPA-based backend")

Coverity reported the following:

*** CID 1461662:  Control flow issues  (DEADCODE)
/drivers/vhost/vdpa.c: 682 in vhost_vdpa_open()
676     	struct vhost_dev *dev;
677     	struct vhost_virtqueue **vqs;
678     	int nvqs, i, r, opened;
679
680     	v = container_of(inode->i_cdev, struct vhost_vdpa, cdev);
681     	if (!v)
vvv     CID 1461662:  Control flow issues  (DEADCODE)
vvv     Execution cannot reach this statement: "return -19;".
682     		return -ENODEV;
683
684     	opened = atomic_cmpxchg(&v->opened, 0, 1);
685     	if (opened)
686     		return -EBUSY;
687

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1461662 ("Control flow issues")
Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend")

Thanks for your attention!

-- 
Coverity-bot

                 reply	other threads:[~2020-04-13 16:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202004130919.C9D96730@keescook \
    --to=keescook@chromium.org \
    --cc=eperezma@redhat.com \
    --cc=gustavo@embeddedor.com \
    --cc=jasowang@redhat.com \
    --cc=linux-next@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=tiwei.bie@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