diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2019-02-04 19:40:08 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-04 20:43:48 +0300 |
commit | c2780c1a3fb724560b1d44f7976e0de17bf153c7 (patch) | |
tree | 8bce72a80aa2dc351876306d3426cec58d9afd19 /drivers/s390/net/qeth_l3_main.c | |
parent | afa0c5904ba16d59b0454f7ee4c807dae350f432 (diff) | |
download | linux-c2780c1a3fb724560b1d44f7976e0de17bf153c7.tar.xz |
s390/qeth: cancel close_dev work before removing a card
A card's close_dev work is scheduled on a driver-wide workqueue. If the
card is removed and freed while the work is still active, this causes a
use-after-free.
So make sure that the work is completed before freeing the card.
Fixes: 0f54761d167f ("qeth: Support VEPA mode")
Signed-off-by: Julian Wiedmann <jwi@linux.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 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 42a7cdc59b76..5e810561cb12 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -2338,6 +2338,7 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) if (cgdev->state == CCWGROUP_ONLINE) qeth_l3_set_offline(cgdev); + cancel_work_sync(&card->close_dev_work); if (qeth_netdev_is_registered(card->dev)) unregister_netdev(card->dev); qeth_l3_clear_ip_htable(card, 0); |