patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Wang, Xiao W" <xiao.w.wang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Maxime Coquelin" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-stable] [PATCH] vdpa/ifc: check return value for PCI config read
Date: Thu, 25 Mar 2021 02:41:28 +0000	[thread overview]
Message-ID: <MN2PR11MB4063E6278896054B290A54649C629@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210309084315.12276-1-xiao.w.wang@intel.com>

> -----Original Message-----
> From: Wang, Xiao W <xiao.w.wang@intel.com>
> Sent: Tuesday, March 9, 2021 4:43 PM
> To: Xia, Chenbo <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; Wang, Xiao W <xiao.w.wang@intel.com>; stable@dpdk.org
> Subject: [PATCH] vdpa/ifc: check return value for PCI config read
> 
> The return value of rte_pci_read_config should be checked.
> 
> Coverity issue: 302860
> Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
> ---
>  drivers/vdpa/ifc/base/ifcvf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
> index 3c0b2dff66..721cb1da8a 100644
> --- a/drivers/vdpa/ifc/base/ifcvf.c
> +++ b/drivers/vdpa/ifc/base/ifcvf.c
> @@ -65,8 +65,13 @@ ifcvf_init_hw(struct ifcvf_hw *hw, PCI_DEV *dev)
>  			hw->common_cfg = get_cap_addr(hw, &cap);
>  			break;
>  		case IFCVF_PCI_CAP_NOTIFY_CFG:
> -			PCI_READ_CONFIG_DWORD(dev, &hw->notify_off_multiplier,
> +			ret = PCI_READ_CONFIG_DWORD(dev,
> +					&hw->notify_off_multiplier,
>  					pos + sizeof(cap));
> +			if (ret < 0) {
> +				DEBUGOUT("failed to read notify_off_multiplier\n");
> +				return -1;
> +			}
>  			hw->notify_base = get_cap_addr(hw, &cap);
>  			hw->notify_region = cap.bar;
>  			break;
> --
> 2.15.1

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>

  reply	other threads:[~2021-03-25  2:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  8:43 Xiao Wang
2021-03-25  2:41 ` Xia, Chenbo [this message]
2021-03-31  6:51 ` Xia, Chenbo

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=MN2PR11MB4063E6278896054B290A54649C629@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=xiao.w.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).