DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Pei, Andy" <andy.pei@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
	"Wang, Xiao W" <xiao.w.wang@intel.com>,
	"Xu, Rosen" <rosen.xu@intel.com>,
	"Xiao, QimaiX" <qimaix.xiao@intel.com>
Subject: RE: [PATCH] vdpa/ifc: fix null pointer dereference
Date: Wed, 15 Jun 2022 02:04:07 +0000	[thread overview]
Message-ID: <SN6PR11MB3504E36C38ADD17C3A7408BA9CAD9@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1654673642-151882-1-git-send-email-andy.pei@intel.com>

Hi Andy,

> -----Original Message-----
> From: Pei, Andy <andy.pei@intel.com>
> Sent: Wednesday, June 8, 2022 3:34 PM
> To: dev@dpdk.org
> Cc: Xia, Chenbo <chenbo.xia@intel.com>; maxime.coquelin@redhat.com; Wang,
> Xiao W <xiao.w.wang@intel.com>; Xu, Rosen <rosen.xu@intel.com>; Xiao,
> QimaiX <qimaix.xiao@intel.com>
> Subject: [PATCH] vdpa/ifc: fix null pointer dereference
> 
> Fix null pointer dereference reported in coverity scan.
> 
> Coverity issue: 378882
> Fixes: 8162a4a9 ("vdpa/ifc/base: access correct register for blk device")

Commit id need to be 12 digits. Also pls leave a blank line between Fixes tag and signed-off

Thanks,
Chenbo

> Signed-off-by: Andy Pei <andy.pei@intel.com>
> ---
>  drivers/vdpa/ifc/base/ifcvf.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c
> index dd475a7..0a9f71a 100644
> --- a/drivers/vdpa/ifc/base/ifcvf.c
> +++ b/drivers/vdpa/ifc/base/ifcvf.c
> @@ -255,6 +255,10 @@
>  	u32 ring_state;
> 
>  	cfg = hw->common_cfg;
> +	if (!cfg) {
> +		DEBUGOUT("common_cfg in HW is NULL.\n");
> +		return;
> +	}
> 
>  	IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg->msix_config);
>  	for (i = 0; i < hw->nr_vring; i++) {
> @@ -262,6 +266,11 @@
>  		IFCVF_WRITE_REG16(0, &cfg->queue_enable);
>  		IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg-
> >queue_msix_vector);
> 
> +		if (!hw->lm_cfg) {
> +			DEBUGOUT("live migration cfg in HW is NULL.\n");
> +			continue;
> +		}
> +
>  		if (hw->device_type == IFCVF_BLK)
>  			ring_state = *(u32 *)(hw->lm_cfg +
>  					IFCVF_LM_RING_STATE_OFFSET +
> --
> 1.8.3.1


  parent reply	other threads:[~2022-06-15  2:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  7:34 Andy Pei
2022-06-08  8:25 ` Wang, Xiao W
2022-06-15  2:04 ` Xia, Chenbo [this message]
2022-06-15  7:08   ` Pei, Andy
2022-06-15  6:23 ` [PATCH v2] " Andy Pei
2022-06-17 12:40   ` Maxime Coquelin
2022-06-17 14:07   ` Maxime Coquelin
2022-06-18  9:04     ` Pei, Andy

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=SN6PR11MB3504E36C38ADD17C3A7408BA9CAD9@SN6PR11MB3504.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=andy.pei@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=qimaix.xiao@intel.com \
    --cc=rosen.xu@intel.com \
    --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).