patch-2.4.22 linux-2.4.22/net/irda/iriap_event.c

Next file: linux-2.4.22/net/irda/irlan/irlan_eth.c
Previous file: linux-2.4.22/net/irda/irda_device.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/net/irda/iriap_event.c linux-2.4.22/net/irda/iriap_event.c
@@ -251,22 +251,25 @@
 static void state_s_make_call(struct iriap_cb *self, IRIAP_EVENT event, 
 			      struct sk_buff *skb) 
 {
+	struct sk_buff *tx_skb;
+
 	ASSERT(self != NULL, return;);
 
 	switch (event) {
 	case IAP_CALL_REQUEST:
-		skb = self->skb;
+		tx_skb = self->skb;
 		self->skb = NULL;
 		
-		irlmp_data_request(self->lsap, skb);
+		irlmp_data_request(self->lsap, tx_skb);
 		iriap_next_call_state(self, S_OUTSTANDING);
 		break;
 	default:
 		IRDA_DEBUG(0, "%s(), Unknown event %d\n", __FUNCTION__, event);
-		if (skb)
-			dev_kfree_skb(skb);
 		break;
 	}
+	/* Cleanup time ! */
+	if (skb)
+		dev_kfree_skb(skb);
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)