From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 8CAFC95D6 for ; Mon, 15 Feb 2016 14:24:38 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id g62so58718759wme.1 for ; Mon, 15 Feb 2016 05:24:38 -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=E+Y9MhMD2zmdOp1lVor7LRcBKL4Y0xt8vk96rx6UheU=; b=GZiL8E0C2J60zvGdzdTLoG9Zx0TLOM9zhU6OjPTnCO+VxbSxDqWPuHGyOi/9t6DV5n KbaHJKwxyYtU6Y4AappUXwc1VBrh72+JYmaVT2qtQw3vmNTVEFxvJQnxU/Ae/+2XGOEQ FmCIIaveA9P8UrDYzpdj5JnD4BkztPsp5qRZBR/7ZKtRx5jOgpKYes75ceaVbTo7/+md C1H7LEzbCxCuqYGPvgrBLRc0FD4yqb98g5BFku/snPTw3XjTnJH4rwjvy/okFgGuCkBf GAvTfkt57iGNWn4ToT91bzuRPrS7Go35oFmDsIqacTFuKLkEIMXH8RR94NEx1M8WjcSj rs6w== 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=E+Y9MhMD2zmdOp1lVor7LRcBKL4Y0xt8vk96rx6UheU=; b=FkNWJ9oqgtF3RkfNIY4PR5AEOaZNdvMmuFaoteCw7UPYFE/Cc6fP1gRQ43QxgsNhby hyZDmq10YGDFiNCg40RADbxRKW1bOGLDpi5UHG/tc4LDtqa56uc1rq1pCWa+vDYg+LEz 59G4l0fItG53AFrJ+l+zyDFu9kgKoUft+8rVTwQAnr5gmLqlBB473rzX/Xm2Kdul1nDs /R54r7cw0EdzMRkGJo1kTaTYShJ+jg/RLT+QS0+4A/aLluq3N5+fcEtQi55uyVkubDHu +YQoe1xdNW+Qy759+Chkb4rxm2P0DmGpKbnjWPFJ6XKhOF4Gd9xxrecdPoGD6YcRcCj0 NDWg== X-Gm-Message-State: AG10YOSY1wqjbYPFcOiiigF7Hl7DpPqpdFl+M8Xlpctk7E8jHGjWQlIxb4xaS+4WUbaZYwQ6 X-Received: by 10.28.210.73 with SMTP id j70mr12107984wmg.8.1455542678339; Mon, 15 Feb 2016 05:24:38 -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 q75sm15784652wmd.6.2016.02.15.05.24.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Feb 2016 05:24:37 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Mon, 15 Feb 2016 14:24:24 +0100 Message-Id: <1455542666-28895-3-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455542666-28895-1-git-send-email-david.marchand@6wind.com> References: <1454831317-4542-1-git-send-email-david.marchand@6wind.com> <1455542666-28895-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v3 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: Mon, 15 Feb 2016 13:24:38 -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 762e91c..b4d4476 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