Florian Fainelli 12758a2824 net: dsa: Do not destroy invalid network devices
[ Upstream commit 382e1eea2d983cd2343482c6a638f497bb44a636 ]

dsa_slave_create() can fail, and dsa_user_port_unapply() will properly check
for the network device not being NULL before attempting to destroy it. We were
not setting the slave network device as NULL if dsa_slave_create() failed, so
we would later on be calling dsa_slave_destroy() on a now free'd and
unitialized network device, causing crashes in dsa_slave_destroy().

Fixes: 83c0afaec7b7 ("net: dsa: Add new binding implementation")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-18 15:11:43 +01:00
..
2016-10-20 14:32:22 -04:00
2016-12-05 14:48:48 -05:00
2016-12-03 23:54:25 -05:00
2017-02-18 15:11:43 +01:00
2017-02-18 15:11:43 +01:00
2016-10-20 11:23:08 -04:00
2016-12-02 14:03:20 -05:00
2016-08-17 19:36:23 -04:00
2016-08-17 19:36:23 -04:00