* [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check
@ 2018-07-16 12:47 Qi Zhang
2018-07-19 12:35 ` Zhang, Qi Z
2018-07-19 12:41 ` Remy Horton
0 siblings, 2 replies; 4+ messages in thread
From: Qi Zhang @ 2018-07-16 12:47 UTC (permalink / raw)
To: remy.horton; +Cc: wenzhuo.lu, dev, Qi Zhang, stable
Add missing NULL point check inside ixgbe_pf_host_uninit, or it may cause
segment fault when detaching a device.
Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
v2: rebase
drivers/net/ixgbe/ixgbe_pf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index c381acf44..4b833ffab 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -128,8 +128,6 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE();
- vfinfo = IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
-
RTE_ETH_DEV_SRIOV(eth_dev).active = 0;
RTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;
RTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0;
@@ -139,6 +137,10 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)
if (vf_num == 0)
return;
+ vfinfo = IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
+ if (*vfinfo == NULL)
+ return;
+
ret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id);
if (ret)
PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret);
--
2.13.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check
2018-07-16 12:47 [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check Qi Zhang
@ 2018-07-19 12:35 ` Zhang, Qi Z
2018-07-19 12:41 ` Remy Horton
1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2018-07-19 12:35 UTC (permalink / raw)
To: Horton, Remy; +Cc: Lu, Wenzhuo, dev, stable
Hi Remy:
Would you mind to give an ack for this patch if no more issue, so I can merge to dpdk-next-net-intel.
Thanks
Qi
> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Monday, July 16, 2018 8:47 PM
> To: Horton, Remy <remy.horton@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org; Zhang, Qi Z
> <qi.z.zhang@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/ixgbe: fix missing NULL point check
>
> Add missing NULL point check inside ixgbe_pf_host_uninit, or it may cause
> segment fault when detaching a device.
>
> Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>
> v2: rebase
>
> drivers/net/ixgbe/ixgbe_pf.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index
> c381acf44..4b833ffab 100644
> --- a/drivers/net/ixgbe/ixgbe_pf.c
> +++ b/drivers/net/ixgbe/ixgbe_pf.c
> @@ -128,8 +128,6 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev
> *eth_dev)
>
> PMD_INIT_FUNC_TRACE();
>
> - vfinfo =
> IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
> -
> RTE_ETH_DEV_SRIOV(eth_dev).active = 0;
> RTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;
> RTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0; @@ -139,6 +137,10
> @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)
> if (vf_num == 0)
> return;
>
> + vfinfo =
> IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
> + if (*vfinfo == NULL)
> + return;
> +
> ret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id);
> if (ret)
> PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret);
> --
> 2.13.6
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check
2018-07-16 12:47 [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check Qi Zhang
2018-07-19 12:35 ` Zhang, Qi Z
@ 2018-07-19 12:41 ` Remy Horton
2018-07-19 12:46 ` Zhang, Qi Z
1 sibling, 1 reply; 4+ messages in thread
From: Remy Horton @ 2018-07-19 12:41 UTC (permalink / raw)
To: Qi Zhang; +Cc: wenzhuo.lu, dev, stable
On 16/07/2018 13:47, Qi Zhang wrote:
> Add missing NULL point check inside ixgbe_pf_host_uninit, or it may cause
> segment fault when detaching a device.
>
> Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check
2018-07-19 12:41 ` Remy Horton
@ 2018-07-19 12:46 ` Zhang, Qi Z
0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2018-07-19 12:46 UTC (permalink / raw)
To: Horton, Remy; +Cc: Lu, Wenzhuo, dev, stable
> -----Original Message-----
> From: Horton, Remy
> Sent: Thursday, July 19, 2018 8:41 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: Re: [PATCH v2] net/ixgbe: fix missing NULL point check
>
>
> On 16/07/2018 13:47, Qi Zhang wrote:
> > Add missing NULL point check inside ixgbe_pf_host_uninit, or it may
> > cause segment fault when detaching a device.
> >
> > Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>
> Acked-by: Remy Horton <remy.horton@intel.com>
Applied to dpdk-next-net-intel.
Thanks!
Qi
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-07-19 12:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 12:47 [dpdk-stable] [PATCH v2] net/ixgbe: fix missing NULL point check Qi Zhang
2018-07-19 12:35 ` Zhang, Qi Z
2018-07-19 12:41 ` Remy Horton
2018-07-19 12:46 ` Zhang, Qi Z
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).