* [dpdk-dev] [PATCH] i40e: dereference before null check
@ 2016-04-18 16:49 Daniel Mrzyglod
2016-04-18 15:55 ` Zhang, Helin
2016-04-18 17:13 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
0 siblings, 2 replies; 6+ messages in thread
From: Daniel Mrzyglod @ 2016-04-18 16:49 UTC (permalink / raw)
To: jing.d.chen, jingjing.wu, helin.zhang; +Cc: dev, Daniel Mrzyglod
Fix issue reported by Coverity.
Coverity ID 13302:
There may be a null pointer dereference, or else the comparison against
null is unnecessary.
In i40evf_config_vlan_pvid: All paths that lead to this null pointer
comparison already dereference the pointer earlier
Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
drivers/net/i40e/i40e_ethdev_vf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2bce69b..0d69322 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -533,7 +533,7 @@ static int
i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
struct i40e_vsi_vlan_pvid_info *info)
{
- struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+ struct i40e_vf *vf = NULL;
int err;
struct vf_cmd_info args;
struct i40e_virtchnl_pvid_info tpid_info;
@@ -542,6 +542,7 @@ i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
PMD_DRV_LOG(ERR, "invalid parameters");
return I40E_ERR_PARAM;
}
+ vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
memset(&tpid_info, 0, sizeof(tpid_info));
tpid_info.vsi_id = vf->vsi_res->vsi_id;
--
2.5.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] i40e: dereference before null check
2016-04-18 16:49 [dpdk-dev] [PATCH] i40e: dereference before null check Daniel Mrzyglod
@ 2016-04-18 15:55 ` Zhang, Helin
2016-04-18 17:13 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
1 sibling, 0 replies; 6+ messages in thread
From: Zhang, Helin @ 2016-04-18 15:55 UTC (permalink / raw)
To: Mrzyglod, DanielX T, Chen, Jing D, Wu, Jingjing; +Cc: dev
> -----Original Message-----
> From: Mrzyglod, DanielX T
> Sent: Tuesday, April 19, 2016 12:49 AM
> To: Chen, Jing D <jing.d.chen@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Zhang, Helin <helin.zhang@intel.com>
> Cc: dev@dpdk.org; Mrzyglod, DanielX T <danielx.t.mrzyglod@intel.com>
> Subject: [PATCH] i40e: dereference before null check
>
> Fix issue reported by Coverity.
> Coverity ID 13302:
> There may be a null pointer dereference, or else the comparison against null is
> unnecessary.
Does that really happen? I guess not.
If I am correct, I'd suggest to just remove the check of if (dev == NULL) as not needed.
/Helin
>
> In i40evf_config_vlan_pvid: All paths that lead to this null pointer comparison
> already dereference the pointer earlier
>
> Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
> drivers/net/i40e/i40e_ethdev_vf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 2bce69b..0d69322 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -533,7 +533,7 @@ static int
> i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
> struct i40e_vsi_vlan_pvid_info *info) {
> - struct i40e_vf *vf =
> I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> + struct i40e_vf *vf = NULL;
> int err;
> struct vf_cmd_info args;
> struct i40e_virtchnl_pvid_info tpid_info; @@ -542,6 +542,7 @@
> i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
> PMD_DRV_LOG(ERR, "invalid parameters");
> return I40E_ERR_PARAM;
> }
> + vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>
> memset(&tpid_info, 0, sizeof(tpid_info));
> tpid_info.vsi_id = vf->vsi_res->vsi_id;
> --
> 2.5.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH v2] i40e: dereference before null check
2016-04-18 16:49 [dpdk-dev] [PATCH] i40e: dereference before null check Daniel Mrzyglod
2016-04-18 15:55 ` Zhang, Helin
@ 2016-04-18 17:13 ` Daniel Mrzyglod
2016-04-27 6:30 ` Zhang, Helin
2016-04-27 6:34 ` Wu, Jingjing
1 sibling, 2 replies; 6+ messages in thread
From: Daniel Mrzyglod @ 2016-04-18 17:13 UTC (permalink / raw)
To: jing.d.chen, jingjing.wu, helin.zhang; +Cc: dev, Daniel Mrzyglod
Fix issue reported by Coverity.
Coverity ID 13302:
There may be a null pointer dereference, or else the comparison against
null is unnecessary.
In i40evf_config_vlan_pvid: All paths that lead to this null pointer
comparison already dereference the pointer earlier
Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2bce69b..2d75b96 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -538,7 +538,7 @@ i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
struct vf_cmd_info args;
struct i40e_virtchnl_pvid_info tpid_info;
- if (dev == NULL || info == NULL) {
+ if (info == NULL) {
PMD_DRV_LOG(ERR, "invalid parameters");
return I40E_ERR_PARAM;
}
--
2.5.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: dereference before null check
2016-04-18 17:13 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
@ 2016-04-27 6:30 ` Zhang, Helin
2016-04-27 6:34 ` Wu, Jingjing
1 sibling, 0 replies; 6+ messages in thread
From: Zhang, Helin @ 2016-04-27 6:30 UTC (permalink / raw)
To: Mrzyglod, DanielX T, Chen, Jing D, Wu, Jingjing; +Cc: dev
> -----Original Message-----
> From: Mrzyglod, DanielX T
> Sent: Tuesday, April 19, 2016 1:13 AM
> To: Chen, Jing D; Wu, Jingjing; Zhang, Helin
> Cc: dev@dpdk.org; Mrzyglod, DanielX T
> Subject: [PATCH v2] i40e: dereference before null check
>
> Fix issue reported by Coverity.
> Coverity ID 13302:
> There may be a null pointer dereference, or else the comparison against null
> is unnecessary.
>
> In i40evf_config_vlan_pvid: All paths that lead to this null pointer comparison
> already dereference the pointer earlier
>
> Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: dereference before null check
2016-04-18 17:13 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2016-04-27 6:30 ` Zhang, Helin
@ 2016-04-27 6:34 ` Wu, Jingjing
2016-05-03 10:46 ` Bruce Richardson
1 sibling, 1 reply; 6+ messages in thread
From: Wu, Jingjing @ 2016-04-27 6:34 UTC (permalink / raw)
To: Mrzyglod, DanielX T, Chen, Jing D, Zhang, Helin; +Cc: dev
> -----Original Message-----
> From: Mrzyglod, DanielX T
> Sent: Tuesday, April 19, 2016 1:13 AM
> To: Chen, Jing D; Wu, Jingjing; Zhang, Helin
> Cc: dev@dpdk.org; Mrzyglod, DanielX T
> Subject: [PATCH v2] i40e: dereference before null check
>
> Fix issue reported by Coverity.
> Coverity ID 13302:
> There may be a null pointer dereference, or else the comparison against null
> is unnecessary.
>
> In i40evf_config_vlan_pvid: All paths that lead to this null pointer comparison
> already dereference the pointer earlier
>
> Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH v2] i40e: dereference before null check
2016-04-27 6:34 ` Wu, Jingjing
@ 2016-05-03 10:46 ` Bruce Richardson
0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2016-05-03 10:46 UTC (permalink / raw)
To: Wu, Jingjing; +Cc: Mrzyglod, DanielX T, Chen, Jing D, Zhang, Helin, dev
On Wed, Apr 27, 2016 at 06:34:03AM +0000, Wu, Jingjing wrote:
>
>
> > -----Original Message-----
> > From: Mrzyglod, DanielX T
> > Sent: Tuesday, April 19, 2016 1:13 AM
> > To: Chen, Jing D; Wu, Jingjing; Zhang, Helin
> > Cc: dev@dpdk.org; Mrzyglod, DanielX T
> > Subject: [PATCH v2] i40e: dereference before null check
> >
> > Fix issue reported by Coverity.
> > Coverity ID 13302:
> > There may be a null pointer dereference, or else the comparison against null
> > is unnecessary.
> >
> > In i40evf_config_vlan_pvid: All paths that lead to this null pointer comparison
> > already dereference the pointer earlier
> >
> > Fixes: 2b12431b5369 ("i40e: add vlan stripping and insertion to VF")
> >
> > Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>
>
Applied to dpdk-next-net/rel_16_07
/Bruce
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-05-03 10:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-18 16:49 [dpdk-dev] [PATCH] i40e: dereference before null check Daniel Mrzyglod
2016-04-18 15:55 ` Zhang, Helin
2016-04-18 17:13 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2016-04-27 6:30 ` Zhang, Helin
2016-04-27 6:34 ` Wu, Jingjing
2016-05-03 10:46 ` Bruce Richardson
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).