Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594314

[PATCH] virtio: remove redundant check on error return err

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] virtio: remove redundant check on error return err
Date 2017-03-07 16:00 +0100
Message-ID <tioKJ-w2-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.com>

err has previously been checked for a -ve error return so this
redundant check can be removed.

Detected by CoverityScan, CID#1415271 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/virtio/virtio_pci_common.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c
index df548a6..ceb4395 100644
--- a/drivers/virtio/virtio_pci_common.c
+++ b/drivers/virtio/virtio_pci_common.c
@@ -173,8 +173,6 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs,
 		if (err < 0)
 			return err;
 	}
-	if (err < 0)
-		return err;
 
 	vp_dev->msix_vectors = nvectors;
 	vp_dev->msix_names = kmalloc_array(nvectors,
-- 
2.10.2

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] virtio: remove redundant check on error return err Colin King <colin.king@canonical.com> - 2017-03-07 16:00 +0100
  Re: [PATCH] virtio: remove redundant check on error return err Stefan Hajnoczi <stefanha@gmail.com> - 2017-03-10 04:40 +0100

csiph-web