Commit fc9c2460 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

qeth: avoid crash in case of layer mismatch for VSWITCH

For z/VM GuestLAN or VSWITCH devices the transport layer is
configured in z/VM. The layer2 attribute of a participating Linux
device has to match the z/VM definition. In case of a mismatch
Linux currently crashes in qeth recovery due to a reference to the
not yet existing net_device.
Solution: add a check for existence of net_device and add a message
pointing to the mismatch of layer definitions in Linux and z/VM.
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe94e2e0
...@@ -572,6 +572,10 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel, ...@@ -572,6 +572,10 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel,
card = CARD_FROM_CDEV(channel->ccwdev); card = CARD_FROM_CDEV(channel->ccwdev);
if (qeth_check_idx_response(iob->data)) { if (qeth_check_idx_response(iob->data)) {
qeth_clear_ipacmd_list(card); qeth_clear_ipacmd_list(card);
if (((iob->data[2] & 0xc0) == 0xc0) && iob->data[4] == 0xf6)
dev_err(&card->gdev->dev,
"The qeth device is not configured "
"for the OSI layer required by z/VM\n");
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
goto out; goto out;
} }
......
...@@ -1126,9 +1126,11 @@ static int qeth_l2_recover(void *ptr) ...@@ -1126,9 +1126,11 @@ static int qeth_l2_recover(void *ptr)
dev_info(&card->gdev->dev, dev_info(&card->gdev->dev,
"Device successfully recovered!\n"); "Device successfully recovered!\n");
else { else {
rtnl_lock(); if (card->dev) {
dev_close(card->dev); rtnl_lock();
rtnl_unlock(); dev_close(card->dev);
rtnl_unlock();
}
dev_warn(&card->gdev->dev, "The qeth device driver " dev_warn(&card->gdev->dev, "The qeth device driver "
"failed to recover an error on the device\n"); "failed to recover an error on the device\n");
} }
......
...@@ -2082,9 +2082,11 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) ...@@ -2082,9 +2082,11 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode)
if (recovery_mode) if (recovery_mode)
qeth_l3_stop(card->dev); qeth_l3_stop(card->dev);
else { else {
rtnl_lock(); if (card->dev) {
dev_close(card->dev); rtnl_lock();
rtnl_unlock(); dev_close(card->dev);
rtnl_unlock();
}
} }
if (!card->use_hard_stop) { if (!card->use_hard_stop) {
rc = qeth_send_stoplan(card); rc = qeth_send_stoplan(card);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment