Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754139AbdCJDhv (ORCPT ); Thu, 9 Mar 2017 22:37:51 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35422 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbdCJDhq (ORCPT ); Thu, 9 Mar 2017 22:37:46 -0500 MIME-Version: 1.0 In-Reply-To: <20170307140821.29689-1-colin.king@canonical.com> References: <20170307140821.29689-1-colin.king@canonical.com> From: Stefan Hajnoczi Date: Fri, 10 Mar 2017 11:36:52 +0800 Message-ID: Subject: Re: [PATCH] virtio: remove redundant check on error return err To: Colin King Cc: "Michael S . Tsirkin" , Jason Wang , Linux Virtualization , kernel-janitors@vger.kernel.org, linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1027 Lines: 28 On Tue, Mar 7, 2017 at 10:08 PM, Colin King wrote: > From: Colin Ian King > > 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 > --- > 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, Reviewed-by: Stefan Hajnoczi