net/bonding: fix crash when primary slave set
authorTomasz Kulasek <tomaszx.kulasek@intel.com>
Wed, 26 Jul 2017 15:50:48 +0000 (17:50 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 31 Jul 2017 17:58:41 +0000 (19:58 +0200)
commit466b0ace2df9cab7f45ae2c3102d5a979c7b604d
tree2e1a5d8196fd9b3e2f29f15ce99e91cbc3d21959
parent935bceb9ba0de8a7a276d5b3dd41e0168a273f26
net/bonding: fix crash when primary slave set

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>
Acked-by: Declan Doherty <declan.doherty@intel.com>
drivers/net/bonding/rte_eth_bond_api.c