qeth: delete napi struct when removing a qeth device
authorUrsula Braun <ubraun@linux.vnet.ibm.com>
Mon, 4 Jul 2016 12:07:16 +0000 (14:07 +0200)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:13:48 +0000 (13:13 +0000)
commit 7831b4ff0d926e0deeaabef9db8800ed069a2757 upstream.

A qeth_card contains a napi_struct linked to the net_device during
device probing. This struct must be deleted when removing the qeth
device, otherwise Panic on oops can occur when qeth devices are
repeatedly removed and added.

Fixes: a1c3ed4c9ca ("qeth: NAPI support for l2 and l3 discipline")
Cc: stable@vger.kernel.org # v2.6.37+
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Tested-by: Alexander Klein <ALKL@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index ec8ccdae7aba3d5b2685f4c8e7954912259b7870..0090de46aa5e66a354e7846cff84c83fab607ea8 100644 (file)
@@ -898,6 +898,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
                qeth_l2_set_offline(cgdev);
 
        if (card->dev) {
+               netif_napi_del(&card->napi);
                unregister_netdev(card->dev);
                card->dev = NULL;
        }
index c1b0b2761f8dce6e0d3ad709902eeb19a925beba..7366bef742de88ef00537c1dee0a3c6de633e0a4 100644 (file)
@@ -3333,6 +3333,7 @@ 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);
                card->dev = NULL;
        }