From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 0F54F5934 for ; Sun, 7 Feb 2016 08:48:45 +0100 (CET) Received: by mail-wm0-f47.google.com with SMTP id g62so96681037wme.0 for ; Sat, 06 Feb 2016 23:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Twcz8ENn+192weqrr/FaADvNzKQcn39CEDhkHDZrLfE=; b=cPrwtCiDVSz8YT4oMeCL9SG9n9dYfZxN0fh8Rr5fC/X/1V7UKz6H/OAZfv6h5Bg1GG 9lhLONyBf7Y6YQ/lOVtj22Ts1wb/5lceny3EHfMO1vuP64rIca3zrbMH2HXBI0Z7qq4h PtwoahZxi2LykupXd1A2Yph5qsJ8nKOYA9SZtK5aj6SdIXHLYct4Prdqw2XC07mHqNWk cnOYQf5IuL13V7t/FiLOiSm3OtU/vXm50UveXQVwhA+KMqy+FlYtXk2P2GRfvLDm5ulZ GtRLA4koQv9CnErTIixgOYBd+ARbYkXf/Z/3SSvV8HGhvQK/dlVXS4Pzq0y68KshH6ox 7Cww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Twcz8ENn+192weqrr/FaADvNzKQcn39CEDhkHDZrLfE=; b=PD8GYphZ8RegsFwBJXkZ7LSnPKlpVHCJd/G1nvjUBxZ4ISNExl8woYxMMLFpt7Al+p YNWUg5K9/y2EepE9MwttGkXydxPij8mUIZtkGkRrD43G/hlQJ72yWb/PvDAPATrFnkcm 8qRgJkfCORjFnI4t46/jnvAGjZNQezijblLqXOVKi855hE/LCY9pSj+zUosju6mBv4nV vN4XXBF3zQRzzt9SFTZA27r3dNmFlLjAE46saLqQ5KOC2xpFr3h136cF8xneirhJyNDf izuIcihgdeVU7eOhjjCHGg7ca9FnagwXgNqReT5xZFmu+kS1Rij40zh+pFbPxTVInNXf y3Pw== X-Gm-Message-State: AG10YOS8JQ8LrO4lOn57SBKhQtaVpDYFrTYQ8RPgaW8VYyMLSiJwIlcBrbSgMAjffAIWBo60 X-Received: by 10.194.57.100 with SMTP id h4mr25505105wjq.21.1454831325787; Sat, 06 Feb 2016 23:48:45 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id lw7sm23737165wjb.19.2016.02.06.23.48.44 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 06 Feb 2016 23:48:45 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Sun, 7 Feb 2016 08:48:35 +0100 Message-Id: <1454831317-4542-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454831317-4542-1-git-send-email-david.marchand@6wind.com> References: <1454694945-18040-1-git-send-email-david.marchand@6wind.com> <1454831317-4542-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 2/4] virtio: fix incorrect check when mapping pci resources X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Feb 2016 07:48:46 -0000 According to the api, rte_eal_pci_map_device is only successful when returning 0. Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") Signed-off-by: David Marchand Acked-by: Yuanhan Liu --- drivers/net/virtio/virtio_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index cd8b0ae..b1610dd 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -795,7 +795,7 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) struct virtio_pci_cap cap; int ret; - if (rte_eal_pci_map_device(dev) < 0) { + if (rte_eal_pci_map_device(dev)) { PMD_INIT_LOG(DEBUG, "failed to map pci device!"); return -1; } -- 1.9.1