diff options
author | Julian Wiedmann <jwi@linux.vnet.ibm.com> | 2018-03-20 07:59:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-22 11:52:30 -0400 |
commit | 6be687395b3124f002a653c1a50b3260222b3cd7 (patch) | |
tree | bf6745b4a0e6676f097e26200685e0670b38f089 /drivers/s390/net/qeth_l3_main.c | |
parent | 3d21ac6fe92d8dc1040c2d8f4f0a70cab9728f06 (diff) | |
download | blackbird-op-linux-6be687395b3124f002a653c1a50b3260222b3cd7.tar.gz blackbird-op-linux-6be687395b3124f002a653c1a50b3260222b3cd7.zip |
s390/qeth: free netdevice when removing a card
On removal, a qeth card's netdevice is currently not properly freed
because the call chain looks as follows:
qeth_core_remove_device(card)
lx_remove_device(card)
unregister_netdev(card->dev)
card->dev = NULL !!!
qeth_core_free_card(card)
if (card->dev) !!!
free_netdev(card->dev)
Fix it by free'ing the netdev straight after unregistering. This also
fixes the sysfs-driven layer switch case (qeth_dev_layer2_store()),
where the need to free the current netdevice was not considered at all.
Note that free_netdev() takes care of the netif_napi_del() for us too.
Fixes: 4a71df50047f ("qeth: new qeth device driver")
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_l3_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 962a04b68dd2..b6b12220da71 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -2865,8 +2865,8 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) qeth_l3_set_offline(cgdev); if (card->dev) { - netif_napi_del(&card->napi); unregister_netdev(card->dev); + free_netdev(card->dev); card->dev = NULL; } |