Commit 02472e28 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: don't process empty bridge port events

Discard events that don't contain any entries. This shouldn't happen,
but subsequent code relies on being able to use entry 0. So better
be safe than accessing garbage.

Fixes: b4d72c08 ("qeth: bridgeport support - basic control")
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c94a882
...@@ -1140,6 +1140,10 @@ static void qeth_bridge_state_change(struct qeth_card *card, ...@@ -1140,6 +1140,10 @@ static void qeth_bridge_state_change(struct qeth_card *card,
int extrasize; int extrasize;
QETH_CARD_TEXT(card, 2, "brstchng"); QETH_CARD_TEXT(card, 2, "brstchng");
if (qports->num_entries == 0) {
QETH_CARD_TEXT(card, 2, "BPempty");
return;
}
if (qports->entry_length != sizeof(struct qeth_sbp_port_entry)) { if (qports->entry_length != sizeof(struct qeth_sbp_port_entry)) {
QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length); QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length);
return; return;
......
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