From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by dpdk.org (Postfix) with ESMTP id 61D452B92 for ; Mon, 19 Nov 2018 13:25:56 +0100 (CET) Received: by mail-wr1-f66.google.com with SMTP id b13so31812417wrx.6 for ; Mon, 19 Nov 2018 04:25:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JTsmw6mrK2OZOWjCmEUXr661B6kpEIFUTohLiZ/JqUw=; b=uQyyU3AWJb06n33EteIzS7WfQ/6lr3zVNcLeDvlYTMfwPIy67gSAD9Hf4kc5S7I9PF oFfo/1Mf58T+RT5IovJCIpi2EZqYSrkE/MIVSYtqzKM90LomPIlr9CuKV86kBd9o/l1m 6oIGj8IW73cJd8YpH5HuTv2jEOTzXfC93CIRSJN9IRiwAhTxPpzl+AFbn2hPYNIb3ojP G0wWZQXRoqzrn2btL0SYElPnFgLsdKw+pBTuOClZSQCAkmmOPtZUf+KfX6IU/nG0NLyL Y8xdeGjUKAVQkkbLEI2KbFTj2ECD+G6tOvXPMPYhTDLZWr4bbaN0UwvRCcym+3K13kOj 0YAw== X-Gm-Message-State: AA+aEWZuSoBxDE0s1Pc9TvgpwgioEsbgrvpZP8q4heg4xAq1XuXzgCjp je9NvGaFkDAk0E5LWHWmcVk= X-Google-Smtp-Source: AFSGD/VF8ONwbzdugI+aALVDA++op3jnf2qJykUJg06XUUbrpY9I3jkoKWg4ug/FNnRSfKfOpotErQ== X-Received: by 2002:a5d:49cd:: with SMTP id t13mr11208669wrs.144.1542630355929; Mon, 19 Nov 2018 04:25:55 -0800 (PST) Received: from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556]) by smtp.gmail.com with ESMTPSA id t69-v6sm33498858wmt.5.2018.11.19.04.25.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:55 -0800 (PST) From: Luca Boccassi To: Tiwei Bie Cc: Maxime Coquelin , dpdk stable Date: Mon, 19 Nov 2018 12:25:25 +0000 Message-Id: <20181119122538.14207-8-bluca@debian.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119122538.14207-1-bluca@debian.org> References: <20181108180111.25873-1-bluca@debian.org> <20181119122538.14207-1-bluca@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/virtio: fix unchecked return value' has been queued to LTS release 16.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 12:25:56 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/21/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Luca Boccassi --- >>From 87b9d321789f9bdaa2cf11df2f7377bc1145e7fa Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 7 Nov 2018 17:01:01 +0800 Subject: [PATCH] net/virtio: fix unchecked return value [ upstream commit ecfae1510edc1391285aa566a2d31e7eae8fc6d2 ] Coverity issue: 302861 Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_pci.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index f6d697f38..13ad57dfd 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -690,9 +690,15 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) hw->common_cfg = get_cfg_addr(dev, &cap); break; case VIRTIO_PCI_CAP_NOTIFY_CFG: - rte_eal_pci_read_config(dev, &hw->notify_off_multiplier, - 4, pos + sizeof(cap)); - hw->notify_base = get_cfg_addr(dev, &cap); + ret = rte_eal_pci_read_config(dev, + &hw->notify_off_multiplier, + 4, pos + sizeof(cap)); + if (ret != 4) + PMD_INIT_LOG(DEBUG, + "failed to read notify_off_multiplier, ret %d", + ret); + else + hw->notify_base = get_cfg_addr(dev, &cap); break; case VIRTIO_PCI_CAP_DEVICE_CFG: hw->dev_cfg = get_cfg_addr(dev, &cap); -- 2.19.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-19 12:15:18.275847477 +0000 +++ 0008-net-virtio-fix-unchecked-return-value.patch 2018-11-19 12:15:18.075611433 +0000 @@ -1,31 +1,33 @@ -From ecfae1510edc1391285aa566a2d31e7eae8fc6d2 Mon Sep 17 00:00:00 2001 +From 87b9d321789f9bdaa2cf11df2f7377bc1145e7fa Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Wed, 7 Nov 2018 17:01:01 +0800 Subject: [PATCH] net/virtio: fix unchecked return value +[ upstream commit ecfae1510edc1391285aa566a2d31e7eae8fc6d2 ] + Coverity issue: 302861 Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0") -Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- - drivers/net/virtio/virtio_pci.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) + drivers/net/virtio/virtio_pci.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c -index 21110cd69..c8883c32e 100644 +index f6d697f38..13ad57dfd 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c -@@ -614,9 +614,15 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) +@@ -690,9 +690,15 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw) hw->common_cfg = get_cfg_addr(dev, &cap); break; case VIRTIO_PCI_CAP_NOTIFY_CFG: -- rte_pci_read_config(dev, &hw->notify_off_multiplier, -+ ret = rte_pci_read_config(dev, -+ &hw->notify_off_multiplier, - 4, pos + sizeof(cap)); +- rte_eal_pci_read_config(dev, &hw->notify_off_multiplier, +- 4, pos + sizeof(cap)); - hw->notify_base = get_cfg_addr(dev, &cap); ++ ret = rte_eal_pci_read_config(dev, ++ &hw->notify_off_multiplier, ++ 4, pos + sizeof(cap)); + if (ret != 4) + PMD_INIT_LOG(DEBUG, + "failed to read notify_off_multiplier, ret %d",