diff options
author | Julian Wiedmann <jwi@linux.ibm.com> | 2020-07-30 17:01:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-31 16:44:36 -0700 |
commit | 02472e28b9a45471c6d8729ff2c7422baa9be46a (patch) | |
tree | 572dcf196182b265b285a63fb0fc54192ae5a201 /drivers/s390 | |
parent | 7c94a88295008f66e9a0efc1c15d8511f73a0366 (diff) | |
download | linux-02472e28b9a45471c6d8729ff2c7422baa9be46a.tar.bz2 |
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: b4d72c08b358 ("qeth: bridgeport support - basic control")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 38e97bbde9ed..8b342a88ff5c 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -1140,6 +1140,10 @@ static void qeth_bridge_state_change(struct qeth_card *card, int extrasize; 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)) { QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length); return; |