s390/qeth: unregister netdevice only when registered
authorJulian Wiedmann <jwi@linux.ibm.com>
Fri, 2 Nov 2018 18:04:10 +0000 (19:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Nov 2018 17:44:05 +0000 (10:44 -0700)
commit30356d08159d7899438e94503ae322a8b881e205
treedf4aaea6626e6a7367f782ebd43f3223f1f01b95
parentbd74a7f9cc033cf4d405788f80292268987dc0c5
s390/qeth: unregister netdevice only when registered

qeth only registers its netdevice when the qeth device is first set
online. Thus a device that has never been set online will trigger
a WARN ("network todo 'hsi%d' but state 0") in unregister_netdev() when
removed.

Fix this by protecting the unregister step, just like we already protect
against repeated registering of the netdevice.

Fixes: d3d1b205e89f ("s390/qeth: allocate netdevice early")
Reported-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c