aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2008-10-24 05:16:55 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-10-27 14:49:00 -0400
commit2d488c2f514a6c5248a0773c78345626abdc1818 (patch)
tree5400c148987e270a38aa15b76144cbfc40a6b93c /drivers/s390/net
parentcc181282fb2fa1af6d532f1333dd42af4814ff17 (diff)
qeth: avoid skb_under_panic for malformatted inbound data
To make the qeth driver more robust in case of malformatted inbound packets due to hardware problems, an additional check for OSN-card-type is added for OSN-type packets. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r--drivers/s390/net/qeth_l2_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index fdf4ffa2e714..1b1e80336d2c 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -449,12 +449,15 @@ static void qeth_l2_process_inbound_buffer(struct qeth_card *card,
449 netif_rx(skb); 449 netif_rx(skb);
450 break; 450 break;
451 case QETH_HEADER_TYPE_OSN: 451 case QETH_HEADER_TYPE_OSN:
452 skb_push(skb, sizeof(struct qeth_hdr)); 452 if (card->info.type == QETH_CARD_TYPE_OSN) {
453 skb_copy_to_linear_data(skb, hdr, 453 skb_push(skb, sizeof(struct qeth_hdr));
454 skb_copy_to_linear_data(skb, hdr,
454 sizeof(struct qeth_hdr)); 455 sizeof(struct qeth_hdr));
455 len = skb->len; 456 len = skb->len;
456 card->osn_info.data_cb(skb); 457 card->osn_info.data_cb(skb);
457 break; 458 break;
459 }
460 /* else unknown */
458 default: 461 default:
459 dev_kfree_skb_any(skb); 462 dev_kfree_skb_any(skb);
460 QETH_DBF_TEXT(TRACE, 3, "inbunkno"); 463 QETH_DBF_TEXT(TRACE, 3, "inbunkno");