patch-2.4.0-test10 linux/drivers/media/video/tea6300.c

Next file: linux/drivers/net/3c501.c
Previous file: linux/drivers/media/video/tda9875.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test9/linux/drivers/media/video/tea6300.c linux/drivers/media/video/tea6300.c
@@ -15,6 +15,10 @@
  * balance (different left,right values) and, if someone ever finds a card
  * with the support (or if you're careful with a soldering iron), fade
  * (front/back).
+ *
+ * Changes:
+ * Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 08/14/2000
+ * - resource allocation fixes in tea6300_attach
  */
 
 #include <linux/module.h>
@@ -170,8 +174,10 @@
         client->addr = addr;
 
 	client->data = tea = kmalloc(sizeof *tea,GFP_KERNEL);
-	if (!tea)
+	if (!tea) {
+		kfree(client);
 		return -ENOMEM;
+	}
 	memset(tea,0,sizeof *tea);
 	do_tea6300_init(client);
 

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