linux/drivers/s390
Julian Wiedmann 8b5026bc16 s390/qeth: fix qdio teardown after early init error
qeth_l?_set_online() goes through a number of initialization steps, and
on any error uses qeth_l?_stop_card() to tear down the residual state.

The first initialization step is qeth_core_hardsetup_card(). When this
fails after having established a QDIO context on the device
(ie. somewhere after qeth_mpc_initialize()), qeth_l?_stop_card() doesn't
shut down this QDIO context again (since the card state hasn't
progressed from DOWN at this stage).

Even worse, we then call qdio_free() as final teardown step to free the
QDIO data structures - while some of them are still hooked into wider
QDIO infrastructure such as the IRQ list. This is inevitably followed by
use-after-frees and other nastyness.

Fix this by unconditionally calling qeth_qdio_clear_card() to shut down
the QDIO context, and also to halt/clear any pending activity on the
various IO channels.
Remove the naive attempt at handling the teardown in
qeth_mpc_initialize(), it clearly doesn't suffice and we're handling it
properly now in the wider teardown code.

Fixes: 4a71df5004 ("qeth: new qeth device driver")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-24 22:41:06 -08:00
..
block s390/dasd: fix typo in copyright statement 2019-12-20 11:52:01 -07:00
char
cio s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly 2019-12-20 11:52:01 -07:00
crypto s390/zcrypt: handle new reply code FILTERED_BY_HYPERVISOR 2019-11-30 10:52:44 +01:00
net s390/qeth: fix qdio teardown after early init error 2019-12-24 22:41:06 -08:00
scsi
virtio
Makefile