]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
IrDA: Incorrect TTP header reservation
authorJeet Chaudhuri <jeetlinux@yahoo.co.in>
Wed, 25 Apr 2007 19:53:20 +0000 (21:53 +0200)
committerAdrian Bunk <bunk@stusta.de>
Wed, 25 Apr 2007 19:53:20 +0000 (21:53 +0200)
We must reserve SAR + MAX_HEADER bytes for IrLMP to fit in.
This fixes an oops reported (and fixed) by Jeet Chaudhuri, when max_sdu_size
is greater than 0.

Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
net/irda/irttp.c

index 8aff254cb41851e7e53e0f96f13bd83d1a6346b2..5fc3597e55283b4874ef94dd671484ea0528312a 100644 (file)
@@ -1100,7 +1100,7 @@ int irttp_connect_request(struct tsap_cb *self, __u8 dtsap_sel,
                        return -ENOMEM;
 
                /* Reserve space for MUX_CONTROL and LAP header */
-               skb_reserve(tx_skb, TTP_MAX_HEADER);
+               skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER);
        } else {
                tx_skb = userdata;
                /*
@@ -1348,7 +1348,7 @@ int irttp_connect_response(struct tsap_cb *self, __u32 max_sdu_size,
                        return -ENOMEM;
 
                /* Reserve space for MUX_CONTROL and LAP header */
-               skb_reserve(tx_skb, TTP_MAX_HEADER);
+               skb_reserve(tx_skb, TTP_MAX_HEADER + TTP_SAR_HEADER);
        } else {
                tx_skb = userdata;
                /*