DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH v1] crypto/virtio: fix return value check
@ 2019-06-19 15:03 Akhil Goyal
  0 siblings, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2019-06-19 15:03 UTC (permalink / raw)
  To: Chenbo Xia, dev; +Cc: jianjay.zhou, stable



> 
> Fix unchecked return value issue for rte_pci_read_config.
> 
> Coverity issue: 302861
> Fixes: 25500d4b8076 ("crypto/virtio: support device init")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v1] crypto/virtio: fix return value check
@ 2019-04-19  0:58 Chenbo Xia
  2019-04-19  0:58 ` Chenbo Xia
  0 siblings, 1 reply; 3+ messages in thread
From: Chenbo Xia @ 2019-04-19  0:58 UTC (permalink / raw)
  To: dev; +Cc: jianjay.zhou, stable

Fix unchecked return value issue for rte_pci_read_config.

Coverity issue: 302861
Fixes: 25500d4b8076 ("crypto/virtio: support device init")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/crypto/virtio/virtio_pci.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_pci.c b/drivers/crypto/virtio/virtio_pci.c
index 0c0c64471..8137b3c5a 100644
--- a/drivers/crypto/virtio/virtio_pci.c
+++ b/drivers/crypto/virtio/virtio_pci.c
@@ -397,9 +397,13 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_crypto_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));
-			hw->notify_base = get_cfg_addr(dev, &cap);
+			if (ret != 4)
+				VIRTIO_CRYPTO_INIT_LOG_ERR(
+					"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.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v1] crypto/virtio: fix return value check
  2019-04-19  0:58 Chenbo Xia
@ 2019-04-19  0:58 ` Chenbo Xia
  0 siblings, 0 replies; 3+ messages in thread
From: Chenbo Xia @ 2019-04-19  0:58 UTC (permalink / raw)
  To: dev; +Cc: jianjay.zhou, stable

Fix unchecked return value issue for rte_pci_read_config.

Coverity issue: 302861
Fixes: 25500d4b8076 ("crypto/virtio: support device init")
Cc: stable@dpdk.org

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/crypto/virtio/virtio_pci.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_pci.c b/drivers/crypto/virtio/virtio_pci.c
index 0c0c64471..8137b3c5a 100644
--- a/drivers/crypto/virtio/virtio_pci.c
+++ b/drivers/crypto/virtio/virtio_pci.c
@@ -397,9 +397,13 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_crypto_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));
-			hw->notify_base = get_cfg_addr(dev, &cap);
+			if (ret != 4)
+				VIRTIO_CRYPTO_INIT_LOG_ERR(
+					"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.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-19 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-19 15:03 [dpdk-dev] [PATCH v1] crypto/virtio: fix return value check Akhil Goyal
  -- strict thread matches above, loose matches on Subject: below --
2019-04-19  0:58 Chenbo Xia
2019-04-19  0:58 ` Chenbo Xia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).