DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>, zhihong.wang@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] net/virtio: fix unchecked return value
Date: Fri, 9 Nov 2018 12:38:05 +0100	[thread overview]
Message-ID: <325febfb-13ae-24c1-83d6-cc0a67e53da6@redhat.com> (raw)
In-Reply-To: <20181107090102.9364-2-tiwei.bie@intel.com>



On 11/7/18 10:01 AM, Tiwei Bie wrote:
> Coverity issue: 302861
> Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
> This patch can't be backported because it depends on the
> API change introduced by below commit in this release.
> 
> commit e8d435f1f3a1 ("bus/pci: harmonize return value of config read")
> 
>   drivers/net/virtio/virtio_pci.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c
> index 21110cd69..c8883c32e 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)
>   			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)
> +				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);
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

  reply	other threads:[~2018-11-09 11:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07  9:01 [dpdk-dev] [PATCH 0/2] Fix Coverity issues for virtio-pci and vhost-user msg Tiwei Bie
2018-11-07  9:01 ` [dpdk-dev] [PATCH 1/2] net/virtio: fix unchecked return value Tiwei Bie
2018-11-09 11:38   ` Maxime Coquelin [this message]
2018-11-07  9:01 ` [dpdk-dev] [PATCH 2/2] vhost: remove unneeded null pointer check Tiwei Bie
2018-11-09 11:38   ` Maxime Coquelin
2018-11-09 14:52 ` [dpdk-dev] [PATCH 0/2] Fix Coverity issues for virtio-pci and vhost-user msg Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=325febfb-13ae-24c1-83d6-cc0a67e53da6@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).