qeth: Fix missing pointer update
authorStefan Raspl <raspl@linux.vnet.ibm.com>
Mon, 22 Apr 2013 01:12:29 +0000 (01:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Apr 2013 19:39:27 +0000 (15:39 -0400)
qeth_hdr_chk_and_bounce() can possibly shift the skb->data
pointer. However, the existing code didn't update the hdr pointer,
which should point to skb->data, accordingly.
Symptoms of this issue are sporadic recoveries.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 762d6dd1e8baad6046ba52dc8c4e3ebd6233e430..ab4d2861ef3c1fe5b5e4cbf454cb22f51fbe0b73 100644 (file)
@@ -929,7 +929,7 @@ void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
 void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
 int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *);
 int qeth_set_access_ctrl_online(struct qeth_card *card, int fallback);
-int qeth_hdr_chk_and_bounce(struct sk_buff *, int);
+int qeth_hdr_chk_and_bounce(struct sk_buff *, struct qeth_hdr **, int);
 int qeth_configure_cq(struct qeth_card *, enum qeth_cq);
 int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
 int qeth_query_ipassists(struct qeth_card *, enum qeth_prot_versions prot);
index 0aa9462c50ecbc8c8876add4168ec3d196d8ea05..a86ce07736ef4d620ca8280c6d71d5697aa11d3f 100644 (file)
@@ -3717,7 +3717,7 @@ int qeth_get_elements_no(struct qeth_card *card,
 }
 EXPORT_SYMBOL_GPL(qeth_get_elements_no);
 
-int qeth_hdr_chk_and_bounce(struct sk_buff *skb, int len)
+int qeth_hdr_chk_and_bounce(struct sk_buff *skb, struct qeth_hdr **hdr, int len)
 {
        int hroom, inpage, rest;
 
@@ -3730,6 +3730,8 @@ int qeth_hdr_chk_and_bounce(struct sk_buff *skb, int len)
                        return 1;
                memmove(skb->data - rest, skb->data, skb->len - skb->data_len);
                skb->data -= rest;
+               skb->tail -= rest;
+               *hdr = (struct qeth_hdr *)skb->data;
                QETH_DBF_MESSAGE(2, "skb bounce len: %d rest: %d\n", len, rest);
        }
        return 0;
index e53c0c8ace7656c26de25bbe1773720bb7361d04..2d425416b0a1106a5d62eef7e3e2e825efe9ab52 100644 (file)
@@ -781,7 +781,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        if (card->info.type != QETH_CARD_TYPE_IQD) {
-               if (qeth_hdr_chk_and_bounce(new_skb,
+               if (qeth_hdr_chk_and_bounce(new_skb, &hdr,
                    sizeof(struct qeth_hdr_layer2)))
                        goto tx_drop;
                rc = qeth_do_send_packet(card, queue, new_skb, hdr,
index 29914ed8bbbce8fa9c4ddc03dbe17f35370d06e7..449676e48fd0f65c65794dc6b56c5e75fca5a8d1 100644 (file)
@@ -3055,7 +3055,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                else
                        len = sizeof(struct qeth_hdr_layer3);
 
-               if (qeth_hdr_chk_and_bounce(new_skb, len))
+               if (qeth_hdr_chk_and_bounce(new_skb, &hdr, len))
                        goto tx_drop;
                rc = qeth_do_send_packet(card, queue, new_skb, hdr,
                                         elements_needed);