patch-2.1.94 linux/drivers/sound/sound_firmware.c

Next file: linux/drivers/sound/sound_syms.c
Previous file: linux/drivers/sound/sound_calls.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.93/linux/drivers/sound/sound_firmware.c linux/drivers/sound/sound_firmware.c
@@ -1,3 +1,4 @@
+#include "os.h"
 #define __KERNEL_SYSCALLS__
 #include <linux/fs.h>
 #include <linux/mm.h>
@@ -19,14 +20,14 @@
 		return 0;
 	}
 	l = lseek(fd, 0L, 2);
-	if (l <= 0 || l > 65535)
+	if (l <= 0 || l > 131072)
 	{
 		printk(KERN_INFO "Invalid firmware '%s'\n", fn);
 		sys_close(fd);
-		  return 0;
+		return 0;
 	}
 	lseek(fd, 0L, 0);
-	dp = kmalloc(l, GFP_KERNEL);
+	dp = vmalloc(l);
 	if (dp == NULL)
 	{
 		printk(KERN_INFO "Out of memory loading '%s'.\n", fn);
@@ -36,7 +37,7 @@
 	if (read(fd, dp, l) != l)
 	{
 		printk(KERN_INFO "Failed to read '%s'.\n", fn);
-		kfree(dp);
+		vfree(dp);
 		sys_close(fd);
 		return 0;
 	}
@@ -45,7 +46,7 @@
 	return (int) l;
 }
 
-int  mod_firmware_load(const char *fn, char **fp)
+int mod_firmware_load(const char *fn, char **fp)
 {
 	int r;
 	mm_segment_t fs = get_fs();
@@ -55,3 +56,4 @@
 	set_fs(fs);
 	return r;
 }
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov