Browse Source

[IRDA]: Fix memory leak in irttp_init()

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan 19 years ago
parent
commit
15166fadb0
1 changed files with 1 additions and 0 deletions
  1. 1 0
      net/irda/irttp.c

+ 1 - 0
net/irda/irttp.c

@@ -100,6 +100,7 @@ int __init irttp_init(void)
 	if (!irttp->tsaps) {
 	if (!irttp->tsaps) {
 		IRDA_ERROR("%s: can't allocate IrTTP hashbin!\n",
 		IRDA_ERROR("%s: can't allocate IrTTP hashbin!\n",
 			   __FUNCTION__);
 			   __FUNCTION__);
+		kfree(irttp);
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}