patch-2.4.21 linux-2.4.21/drivers/sound/emu10k1/audio.c

Next file: linux-2.4.21/drivers/sound/es1370.c
Previous file: linux-2.4.21/drivers/sound/dmasound/dmasound_core.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/sound/emu10k1/audio.c linux-2.4.21/drivers/sound/emu10k1/audio.c
@@ -1135,7 +1135,8 @@
 
 		if ((wiinst = (struct wiinst *) kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) {
 			ERROR();
-			return -ENODEV;
+			kfree(wave_dev);
+			return -ENOMEM;
 		}
 
 		wiinst->recsrc = card->wavein.recsrc;
@@ -1161,6 +1162,8 @@
 			wiinst->format.channels = hweight32(wiinst->fxwc);
 			break;
 		default:
+			kfree(wave_dev);
+			kfree(wiinst);
 			BUG();
 			break;
 		}

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