* [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-18 1:31 [dpdk-dev] [PATCH] net/ice: fix coverity issues Wenzhuo Lu
@ 2019-04-18 1:31 ` Wenzhuo Lu
2019-04-22 6:57 ` Yang, Qiming
` (2 subsequent siblings)
3 siblings, 0 replies; 16+ messages in thread
From: Wenzhuo Lu @ 2019-04-18 1:31 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu, stable
Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ice/ice_ethdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0946b19..5cca4a8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -645,12 +645,14 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
if (!vsi || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* If it's added and configured, return. */
f = ice_find_vlan_filter(vsi, vlan_id);
if (f) {
@@ -710,7 +712,7 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
/**
@@ -720,6 +722,8 @@ struct ice_xstats_name_off {
if (!vsi || vlan_id == 0 || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* Can't find it, return an error */
f = ice_find_vlan_filter(vsi, vlan_id);
if (!f)
@@ -2553,13 +2557,16 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
static int
ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)
{
- struct ice_pf *pf = ICE_VSI_TO_PF(vsi);
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_pf *pf;
+ struct ice_hw *hw;
int ret;
if (!vsi || !lut)
return -EINVAL;
+ pf = ICE_VSI_TO_PF(vsi);
+ hw = ICE_VSI_TO_HW(vsi);
+
if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {
ret = ice_aq_set_rss_lut(hw, vsi->idx, TRUE,
lut, lut_size);
--
1.9.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-18 1:31 [dpdk-dev] [PATCH] net/ice: fix coverity issues Wenzhuo Lu
2019-04-18 1:31 ` Wenzhuo Lu
@ 2019-04-22 6:57 ` Yang, Qiming
2019-04-22 6:57 ` Yang, Qiming
` (2 more replies)
2019-04-23 10:40 ` Ferruh Yigit
2019-04-24 2:43 ` [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference Wenzhuo Lu
3 siblings, 3 replies; 16+ messages in thread
From: Yang, Qiming @ 2019-04-22 6:57 UTC (permalink / raw)
To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo, stable
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
Sent: Thursday, April 18, 2019 9:31 AM
To: dev@dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ice: fix coverity issues
Fix the issues reported by Coverity check, "Null-checking vsi suggests that it may be null, but it has already been dereferenced on all paths leading to the check."
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ice/ice_ethdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 0946b19..5cca4a8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -645,12 +645,14 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
if (!vsi || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* If it's added and configured, return. */
f = ice_find_vlan_filter(vsi, vlan_id);
if (f) {
@@ -710,7 +712,7 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
/**
@@ -720,6 +722,8 @@ struct ice_xstats_name_off {
if (!vsi || vlan_id == 0 || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* Can't find it, return an error */
f = ice_find_vlan_filter(vsi, vlan_id);
if (!f)
@@ -2553,13 +2557,16 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, static int ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size) {
- struct ice_pf *pf = ICE_VSI_TO_PF(vsi);
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_pf *pf;
+ struct ice_hw *hw;
int ret;
if (!vsi || !lut)
return -EINVAL;
+ pf = ICE_VSI_TO_PF(vsi);
+ hw = ICE_VSI_TO_HW(vsi);
+
if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {
ret = ice_aq_set_rss_lut(hw, vsi->idx, TRUE,
lut, lut_size);
--
1.9.3
Acked-by: Qiming Yang <qiming.yang@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-22 6:57 ` Yang, Qiming
@ 2019-04-22 6:57 ` Yang, Qiming
2019-04-22 7:14 ` Rami Rosen
2019-04-23 3:29 ` Zhang, Qi Z
2 siblings, 0 replies; 16+ messages in thread
From: Yang, Qiming @ 2019-04-22 6:57 UTC (permalink / raw)
To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo, stable
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
Sent: Thursday, April 18, 2019 9:31 AM
To: dev@dpdk.org
Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ice: fix coverity issues
Fix the issues reported by Coverity check, "Null-checking vsi suggests that it may be null, but it has already been dereferenced on all paths leading to the check."
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
drivers/net/ice/ice_ethdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 0946b19..5cca4a8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -645,12 +645,14 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
if (!vsi || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* If it's added and configured, return. */
f = ice_find_vlan_filter(vsi, vlan_id);
if (f) {
@@ -710,7 +712,7 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
/**
@@ -720,6 +722,8 @@ struct ice_xstats_name_off {
if (!vsi || vlan_id == 0 || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* Can't find it, return an error */
f = ice_find_vlan_filter(vsi, vlan_id);
if (!f)
@@ -2553,13 +2557,16 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, static int ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size) {
- struct ice_pf *pf = ICE_VSI_TO_PF(vsi);
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_pf *pf;
+ struct ice_hw *hw;
int ret;
if (!vsi || !lut)
return -EINVAL;
+ pf = ICE_VSI_TO_PF(vsi);
+ hw = ICE_VSI_TO_HW(vsi);
+
if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {
ret = ice_aq_set_rss_lut(hw, vsi->idx, TRUE,
lut, lut_size);
--
1.9.3
Acked-by: Qiming Yang <qiming.yang@intel.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-22 6:57 ` Yang, Qiming
2019-04-22 6:57 ` Yang, Qiming
@ 2019-04-22 7:14 ` Rami Rosen
2019-04-22 7:14 ` Rami Rosen
2019-04-23 3:29 ` Zhang, Qi Z
2 siblings, 1 reply; 16+ messages in thread
From: Rami Rosen @ 2019-04-22 7:14 UTC (permalink / raw)
To: Yang, Qiming; +Cc: Lu, Wenzhuo, dev, stable
Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
Reviewed-by: Rami Rosen <ramirose@gmail.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-22 7:14 ` Rami Rosen
@ 2019-04-22 7:14 ` Rami Rosen
0 siblings, 0 replies; 16+ messages in thread
From: Rami Rosen @ 2019-04-22 7:14 UTC (permalink / raw)
To: Yang, Qiming; +Cc: Lu, Wenzhuo, dev, stable
Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
Reviewed-by: Rami Rosen <ramirose@gmail.com>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-22 6:57 ` Yang, Qiming
2019-04-22 6:57 ` Yang, Qiming
2019-04-22 7:14 ` Rami Rosen
@ 2019-04-23 3:29 ` Zhang, Qi Z
2019-04-23 3:29 ` Zhang, Qi Z
2 siblings, 1 reply; 16+ messages in thread
From: Zhang, Qi Z @ 2019-04-23 3:29 UTC (permalink / raw)
To: Yang, Qiming, Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo, stable
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Qiming
> Sent: Monday, April 22, 2019 2:58 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
>
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Thursday, April 18, 2019 9:31 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
> Fix the issues reported by Coverity check, "Null-checking vsi suggests that
> it may be null, but it has already been dereferenced on all paths leading to
> the check."
>
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-23 3:29 ` Zhang, Qi Z
@ 2019-04-23 3:29 ` Zhang, Qi Z
0 siblings, 0 replies; 16+ messages in thread
From: Zhang, Qi Z @ 2019-04-23 3:29 UTC (permalink / raw)
To: Yang, Qiming, Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo, stable
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yang, Qiming
> Sent: Monday, April 22, 2019 2:58 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
>
>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Thursday, April 18, 2019 9:31 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
> Fix the issues reported by Coverity check, "Null-checking vsi suggests that
> it may be null, but it has already been dereferenced on all paths leading to
> the check."
>
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-18 1:31 [dpdk-dev] [PATCH] net/ice: fix coverity issues Wenzhuo Lu
2019-04-18 1:31 ` Wenzhuo Lu
2019-04-22 6:57 ` Yang, Qiming
@ 2019-04-23 10:40 ` Ferruh Yigit
2019-04-23 10:40 ` Ferruh Yigit
2019-04-24 2:15 ` Lu, Wenzhuo
2019-04-24 2:43 ` [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference Wenzhuo Lu
3 siblings, 2 replies; 16+ messages in thread
From: Ferruh Yigit @ 2019-04-23 10:40 UTC (permalink / raw)
To: Wenzhuo Lu, dev; +Cc: stable
On 4/18/2019 2:31 AM, Wenzhuo Lu wrote:
> Fix the issues reported by Coverity check, "Null-checking
> vsi suggests that it may be null, but it has already been
> dereferenced on all paths leading to the check."
Hi Wenzhuo,
Can you please list the coverity issues addressed, the format we have is:
Coverity issue: ####
Also the patch title doesn't say much, can you please put what exactly fixed,
"fix possible null pointer dereference" ?
>
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
<...>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-23 10:40 ` Ferruh Yigit
@ 2019-04-23 10:40 ` Ferruh Yigit
2019-04-24 2:15 ` Lu, Wenzhuo
1 sibling, 0 replies; 16+ messages in thread
From: Ferruh Yigit @ 2019-04-23 10:40 UTC (permalink / raw)
To: Wenzhuo Lu, dev; +Cc: stable
On 4/18/2019 2:31 AM, Wenzhuo Lu wrote:
> Fix the issues reported by Coverity check, "Null-checking
> vsi suggests that it may be null, but it has already been
> dereferenced on all paths leading to the check."
Hi Wenzhuo,
Can you please list the coverity issues addressed, the format we have is:
Coverity issue: ####
Also the patch title doesn't say much, can you please put what exactly fixed,
"fix possible null pointer dereference" ?
>
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
<...>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-23 10:40 ` Ferruh Yigit
2019-04-23 10:40 ` Ferruh Yigit
@ 2019-04-24 2:15 ` Lu, Wenzhuo
2019-04-24 2:15 ` Lu, Wenzhuo
1 sibling, 1 reply; 16+ messages in thread
From: Lu, Wenzhuo @ 2019-04-24 2:15 UTC (permalink / raw)
To: Yigit, Ferruh, dev; +Cc: stable
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, April 23, 2019 6:40 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
> On 4/18/2019 2:31 AM, Wenzhuo Lu wrote:
> > Fix the issues reported by Coverity check, "Null-checking vsi suggests
> > that it may be null, but it has already been dereferenced on all paths
> > leading to the check."
>
> Hi Wenzhuo,
>
> Can you please list the coverity issues addressed, the format we have is:
> Coverity issue: ####
>
> Also the patch title doesn't say much, can you please put what exactly fixed,
> "fix possible null pointer dereference" ?
Thanks for the comments. Will send V2.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
2019-04-24 2:15 ` Lu, Wenzhuo
@ 2019-04-24 2:15 ` Lu, Wenzhuo
0 siblings, 0 replies; 16+ messages in thread
From: Lu, Wenzhuo @ 2019-04-24 2:15 UTC (permalink / raw)
To: Yigit, Ferruh, dev; +Cc: stable
Hi Ferruh,
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, April 23, 2019 6:40 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ice: fix coverity issues
>
> On 4/18/2019 2:31 AM, Wenzhuo Lu wrote:
> > Fix the issues reported by Coverity check, "Null-checking vsi suggests
> > that it may be null, but it has already been dereferenced on all paths
> > leading to the check."
>
> Hi Wenzhuo,
>
> Can you please list the coverity issues addressed, the format we have is:
> Coverity issue: ####
>
> Also the patch title doesn't say much, can you please put what exactly fixed,
> "fix possible null pointer dereference" ?
Thanks for the comments. Will send V2.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference
2019-04-18 1:31 [dpdk-dev] [PATCH] net/ice: fix coverity issues Wenzhuo Lu
` (2 preceding siblings ...)
2019-04-23 10:40 ` Ferruh Yigit
@ 2019-04-24 2:43 ` Wenzhuo Lu
2019-04-24 2:43 ` Wenzhuo Lu
2019-04-24 15:56 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
3 siblings, 2 replies; 16+ messages in thread
From: Wenzhuo Lu @ 2019-04-24 2:43 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu, stable
Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."
Coverity issue: 328509
Coverity issue: 328519
Coverity issue: 328523
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
---
drivers/net/ice/ice_ethdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0946b19..5cca4a8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -645,12 +645,14 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
if (!vsi || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* If it's added and configured, return. */
f = ice_find_vlan_filter(vsi, vlan_id);
if (f) {
@@ -710,7 +712,7 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
/**
@@ -720,6 +722,8 @@ struct ice_xstats_name_off {
if (!vsi || vlan_id == 0 || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* Can't find it, return an error */
f = ice_find_vlan_filter(vsi, vlan_id);
if (!f)
@@ -2553,13 +2557,16 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
static int
ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)
{
- struct ice_pf *pf = ICE_VSI_TO_PF(vsi);
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_pf *pf;
+ struct ice_hw *hw;
int ret;
if (!vsi || !lut)
return -EINVAL;
+ pf = ICE_VSI_TO_PF(vsi);
+ hw = ICE_VSI_TO_HW(vsi);
+
if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {
ret = ice_aq_set_rss_lut(hw, vsi->idx, TRUE,
lut, lut_size);
--
1.9.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference
2019-04-24 2:43 ` [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference Wenzhuo Lu
@ 2019-04-24 2:43 ` Wenzhuo Lu
2019-04-24 15:56 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
1 sibling, 0 replies; 16+ messages in thread
From: Wenzhuo Lu @ 2019-04-24 2:43 UTC (permalink / raw)
To: dev; +Cc: Wenzhuo Lu, stable
Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."
Coverity issue: 328509
Coverity issue: 328519
Coverity issue: 328523
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
---
drivers/net/ice/ice_ethdev.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 0946b19..5cca4a8 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -645,12 +645,14 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
if (!vsi || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* If it's added and configured, return. */
f = ice_find_vlan_filter(vsi, vlan_id);
if (f) {
@@ -710,7 +712,7 @@ struct ice_xstats_name_off {
struct ice_fltr_list_entry *v_list_itr = NULL;
struct ice_vlan_filter *f;
struct LIST_HEAD_TYPE list_head;
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_hw *hw;
int ret = 0;
/**
@@ -720,6 +722,8 @@ struct ice_xstats_name_off {
if (!vsi || vlan_id == 0 || vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
+ hw = ICE_VSI_TO_HW(vsi);
+
/* Can't find it, return an error */
f = ice_find_vlan_filter(vsi, vlan_id);
if (!f)
@@ -2553,13 +2557,16 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,
static int
ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)
{
- struct ice_pf *pf = ICE_VSI_TO_PF(vsi);
- struct ice_hw *hw = ICE_VSI_TO_HW(vsi);
+ struct ice_pf *pf;
+ struct ice_hw *hw;
int ret;
if (!vsi || !lut)
return -EINVAL;
+ pf = ICE_VSI_TO_PF(vsi);
+ hw = ICE_VSI_TO_HW(vsi);
+
if (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {
ret = ice_aq_set_rss_lut(hw, vsi->idx, TRUE,
lut, lut_size);
--
1.9.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/ice: fix possible null pointer dereference
2019-04-24 2:43 ` [dpdk-dev] [PATCH v2] net/ice: fix possible null pointer dereference Wenzhuo Lu
2019-04-24 2:43 ` Wenzhuo Lu
@ 2019-04-24 15:56 ` Ferruh Yigit
2019-04-24 15:56 ` Ferruh Yigit
1 sibling, 1 reply; 16+ messages in thread
From: Ferruh Yigit @ 2019-04-24 15:56 UTC (permalink / raw)
To: Wenzhuo Lu, dev; +Cc: stable
On 4/24/2019 3:43 AM, Wenzhuo Lu wrote:
> Fix the issues reported by Coverity check, "Null-checking
> vsi suggests that it may be null, but it has already been
> dereferenced on all paths leading to the check."
>
> Coverity issue: 328509
> Coverity issue: 328519
> Coverity issue: 328523
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] net/ice: fix possible null pointer dereference
2019-04-24 15:56 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
@ 2019-04-24 15:56 ` Ferruh Yigit
0 siblings, 0 replies; 16+ messages in thread
From: Ferruh Yigit @ 2019-04-24 15:56 UTC (permalink / raw)
To: Wenzhuo Lu, dev; +Cc: stable
On 4/24/2019 3:43 AM, Wenzhuo Lu wrote:
> Fix the issues reported by Coverity check, "Null-checking
> vsi suggests that it may be null, but it has already been
> dereferenced on all paths leading to the check."
>
> Coverity issue: 328509
> Coverity issue: 328519
> Coverity issue: 328523
> Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
> Fixes: ff963bfa7cb1 ("net/ice: support RSS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Acked-by: Qiming Yang <qiming.yang@intel.com>
> Reviewed-by: Rami Rosen <ramirose@gmail.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 16+ messages in thread