home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD2.iso / Sound / soundcore-2.2.1.patch < prev    next >
Text File  |  1999-03-15  |  857b  |  42 lines

  1. --- linux/drivers/sound/sound_core.c.old    Mon Feb  1 14:06:58 1999
  2. +++ linux/drivers/sound/sound_core.c    Mon Feb  1 14:07:13 1999
  3. @@ -63,6 +63,13 @@
  4.      int n=low;
  5.  
  6.      if (index < 0) {    /* first free */
  7. +
  8. +        while (*list && (*list)->unit_minor<n)
  9. +            list=&((*list)->next);
  10. +
  11. +        if (*list && (*list)->unit_minor==n)
  12. +            return -EBUSY;
  13. +
  14.          while(n<top)
  15.          {
  16.              /* Found a hole ? */
  17. @@ -73,7 +80,7 @@
  18.          }
  19.  
  20.          if(n>=top)
  21. -            return -ENOMEM;
  22. +            return -ENOENT;
  23.      } else {
  24.          n = low+(index*16);
  25.          while (*list) {
  26. @@ -141,13 +148,13 @@
  27.      int r;
  28.      struct sound_unit *s=(struct sound_unit *)kmalloc(sizeof(struct sound_unit), GFP_KERNEL);
  29.      if(s==NULL)
  30. -        return -1;
  31. +        return -ENOMEM;
  32.          
  33.      spin_lock(&sound_loader_lock);
  34.      r=__sound_insert_unit(s,list,fops,index,low,top);
  35.      spin_unlock(&sound_loader_lock);
  36.      
  37. -    if(r==-1)
  38. +    if(r<0)
  39.          kfree(s);
  40.      return r;
  41.  }
  42.