Skip to contentSkip to conversation

SKB leak in drivers/isdn/i4l/isdn_x25iface.c

PATCH Applied Eric Sesterhenn 2 participants 2 messages Jun 28, 2006 – Jun 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SKB leak in drivers/isdn/i4l/isdn_x25iface.c

hi,

coverity spotted this leak (id #613), when
we are not configured, we return without
freeing the allocated skb.

drivers/isdn/i4l/isdn_x25iface.c renamed from drivers/isdn/i4l/isdn_x25iface.c.orig +3 -1
@@ -208,7 +208,7 @@ static int isdn_x25iface_receive(struct 
  */
 static int isdn_x25iface_connect_ind(struct concap_proto *cprot)
 {
-	struct sk_buff * skb = dev_alloc_skb(1);
+	struct sk_buff * skb;
 	enum wan_states *state_p 
 	  = &( ( (ix25_pdata_t*) (cprot->proto_data) ) -> state);
 	IX25DEBUG( "isdn_x25iface_connect_ind %s \n"
@@ -220,6 +220,8 @@ static int isdn_x25iface_connect_ind(str
 		return -1;
 	}
 	*state_p = WAN_CONNECTED;
+
+	skb = dev_alloc_skb(1);
 	if( skb ){
 		*( skb_put(skb, 1) ) = 0x01;
 		skb->protocol = x25_type_trans(skb, cprot->net_dev);