diff options
-rw-r--r-- | drivers/s390/net/ctcm_fsms.c | 5 | ||||
-rw-r--r-- | drivers/s390/net/ctcm_main.c | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/net/ctcm_fsms.c b/drivers/s390/net/ctcm_fsms.c index f29c7086fc1..4ded9ac2c5e 100644 --- a/drivers/s390/net/ctcm_fsms.c +++ b/drivers/s390/net/ctcm_fsms.c | |||
@@ -410,9 +410,8 @@ static void chx_rx(fsm_instance *fi, int event, void *arg) | |||
410 | priv->stats.rx_length_errors++; | 410 | priv->stats.rx_length_errors++; |
411 | goto again; | 411 | goto again; |
412 | } | 412 | } |
413 | block_len -= 2; | 413 | if (block_len > 2) { |
414 | if (block_len > 0) { | 414 | *((__u16 *)skb->data) = block_len - 2; |
415 | *((__u16 *)skb->data) = block_len; | ||
416 | ctcm_unpack_skb(ch, skb); | 415 | ctcm_unpack_skb(ch, skb); |
417 | } | 416 | } |
418 | again: | 417 | again: |
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 59ce7fb7308..a7a25383db7 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
@@ -105,7 +105,8 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb) | |||
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | pskb->protocol = ntohs(header->type); | 107 | pskb->protocol = ntohs(header->type); |
108 | if (header->length <= LL_HEADER_LENGTH) { | 108 | if ((header->length <= LL_HEADER_LENGTH) || |
109 | (len <= LL_HEADER_LENGTH)) { | ||
109 | if (!(ch->logflags & LOG_FLAG_ILLEGALSIZE)) { | 110 | if (!(ch->logflags & LOG_FLAG_ILLEGALSIZE)) { |
110 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, | 111 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
111 | "%s(%s): Illegal packet size %d(%d,%d)" | 112 | "%s(%s): Illegal packet size %d(%d,%d)" |