home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog Special Edition 1: Linux
/
CD2.iso
/
Sound
/
soundcore-2.2.1.patch
< prev
next >
Wrap
Text File
|
1999-03-15
|
857b
|
42 lines
--- linux/drivers/sound/sound_core.c.old Mon Feb 1 14:06:58 1999
+++ linux/drivers/sound/sound_core.c Mon Feb 1 14:07:13 1999
@@ -63,6 +63,13 @@
int n=low;
if (index < 0) { /* first free */
+
+ while (*list && (*list)->unit_minor<n)
+ list=&((*list)->next);
+
+ if (*list && (*list)->unit_minor==n)
+ return -EBUSY;
+
while(n<top)
{
/* Found a hole ? */
@@ -73,7 +80,7 @@
}
if(n>=top)
- return -ENOMEM;
+ return -ENOENT;
} else {
n = low+(index*16);
while (*list) {
@@ -141,13 +148,13 @@
int r;
struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL);
if(s==NULL)
- return -1;
+ return -ENOMEM;
spin_lock(&sound_loader_lock);
r=__sound_insert_unit(s,list,fops,index,low,top);
spin_unlock(&sound_loader_lock);
- if(r==-1)
+ if(r<0)
kfree(s);
return r;
}