[PATCH 2.5 IrDA] irtty leaks

From: Jean Tourrilhes (jt@bougret.hpl.hp.com)
Date: Wed Jul 09 2003 - 18:50:20 EST


ir250_irttp_leak.diff :
~~~~~~~~~~~~~~~~~~~~~
                <Stanford checker>
        o [CORRECT] fix two additional potential skb leaks in IrTTP.

diff -u -p linux/net/irda/irttp.d1.c linux/net/irda/irttp.c
--- linux/net/irda/irttp.d1.c Wed Jun 4 13:31:22 2003
+++ linux/net/irda/irttp.c Wed Jun 4 13:34:45 2003
@@ -1094,7 +1094,8 @@ int irttp_connect_request(struct tsap_cb
                  * Check that the client has reserved enough space for
                  * headers
                  */
- ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER, return -1;);
+ ASSERT(skb_headroom(userdata) >= TTP_MAX_HEADER,
+ { dev_kfree_skb(tx_skb); return -1; } );
         }
 
         /* Initialize connection parameters */
@@ -1123,7 +1124,7 @@ int irttp_connect_request(struct tsap_cb
         /* SAR enabled? */
         if (max_sdu_size > 0) {
                 ASSERT(skb_headroom(tx_skb) >= (TTP_MAX_HEADER + TTP_SAR_HEADER),
- return -1;);
+ { dev_kfree_skb(tx_skb); return -1; } );
 
                 /* Insert SAR parameters */
                 frame = skb_push(tx_skb, TTP_HEADER+TTP_SAR_HEADER);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 15 2003 - 22:00:33 EST