patch-2.4.21 linux-2.4.21/net/irda/ircomm/ircomm_core.c

Next file: linux-2.4.21/net/irda/ircomm/ircomm_tty.c
Previous file: linux-2.4.21/net/ipv6/udp.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/net/irda/ircomm/ircomm_core.c linux-2.4.21/net/irda/ircomm/ircomm_core.c
@@ -121,8 +121,10 @@
 	} else
 		ret = ircomm_open_tsap(self);
 
-	if (ret < 0)
+	if (ret < 0) {
+		kfree(self);
 		return NULL;
+	}
 
 	self->service_type = service_type;
 	self->line = line;
@@ -498,7 +500,7 @@
 
 	self = (struct ircomm_cb *) hashbin_get_first(ircomm);
 	while (self != NULL) {
-		ASSERT(self->magic == IRCOMM_MAGIC, return len;);
+		ASSERT(self->magic == IRCOMM_MAGIC, break;);
 
 		if(self->line < 0x10)
 			len += sprintf(buf+len, "ircomm%d", self->line);

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