patch-2.4.22 linux-2.4.22/drivers/sound/ad1889.c

Next file: linux-2.4.22/drivers/sound/ali5455.c
Previous file: linux-2.4.22/drivers/sound/ac97_plugin_ad1980.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/sound/ad1889.c linux-2.4.22/drivers/sound/ad1889.c
@@ -257,7 +257,7 @@
 		return;
 
 	if (dev->ac97_codec)
-		kfree(dev->ac97_codec);
+		ac97_release_codec(dev->ac97_codec);
 
 	for (j = 0; j < AD_MAX_STATES; j++) {
 		dmabuf = &dev->state[j].dmabuf;
@@ -831,9 +831,8 @@
 	struct ac97_codec *ac97;
 	u16 eid;
 
-	if ((ac97 = kmalloc(sizeof(struct ac97_codec), GFP_KERNEL)) == NULL) 
+	if ((ac97 = ac97_alloc_codec()) == NULL) 
 		return -ENOMEM;
-	memset(ac97, 0, sizeof(struct ac97_codec));
 
 	ac97->private_data = dev;
 	ac97->id = id;
@@ -863,7 +862,7 @@
 	return 0;
 
 out_free:
-	kfree(ac97);
+	ac97_release_codec(ac97);
 	return -ENODEV;
 }
 

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