From: Declan Doherty <declan.doherty@intel.com>
To: Tomasz Kulasek <tomaszx.kulasek@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] bonding: fix segfault when primary slave set
Date: Wed, 26 Jul 2017 18:06:56 +0100 [thread overview]
Message-ID: <31a717db-a089-7567-bb5b-49f6693cf343@intel.com> (raw)
In-Reply-To: <20170726155048.10648-1-tomaszx.kulasek@intel.com>
On 26/07/2017 4:50 PM, Tomasz Kulasek wrote:
> rte_eth_bond_primary_set segfaults for invalid port. This patch moves
> devices check before use of internal data.
>
> Fixes: 4c42498d916d ("net/bonding: allow slaves to also be bonded devices")
>
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
> ---
> drivers/net/bonding/rte_eth_bond_api.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
> index 824ab4f..de1d9e0 100644
> --- a/drivers/net/bonding/rte_eth_bond_api.c
> +++ b/drivers/net/bonding/rte_eth_bond_api.c
> @@ -514,15 +514,14 @@
> {
> struct bond_dev_private *internals;
>
> - internals = rte_eth_devices[bonded_port_id].data->dev_private;
> -
> if (valid_bonded_port_id(bonded_port_id) != 0)
> return -1;
>
> + internals = rte_eth_devices[bonded_port_id].data->dev_private;
> +
> if (valid_slave_port_id(slave_port_id, internals->mode) != 0)
> return -1;
>
> -
> internals->user_defined_primary_port = 1;
> internals->primary_port = slave_port_id;
>
>
Acked-by: Declan Doherty <declan.doherty@intel.com>
next prev parent reply other threads:[~2017-07-26 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-26 15:50 Tomasz Kulasek
2017-07-26 17:06 ` Declan Doherty [this message]
2017-07-30 21:43 ` Thomas Monjalon
2017-07-31 12:49 ` Ferruh Yigit
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=31a717db-a089-7567-bb5b-49f6693cf343@intel.com \
--to=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=tomaszx.kulasek@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).