]> Pileus Git - ~andy/linux/blobdiff - sound/oss/via82cxxx_audio.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
[~andy/linux] / sound / oss / via82cxxx_audio.c
index c96cc8c68b3bec1135aefc7fd7e6c370c540121d..f95aa0946758eddee10d995cc233d05005a8ae71 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/poll.h>
 #include <linux/soundcard.h>
 #include <linux/ac97_codec.h>
-#include <linux/smp_lock.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
@@ -1619,7 +1618,7 @@ out:
 }
 
 
-static struct file_operations via_mixer_fops = {
+static const struct file_operations via_mixer_fops = {
        .owner          = THIS_MODULE,
        .open           = via_mixer_open,
        .llseek         = no_llseek,
@@ -2042,7 +2041,7 @@ static int via_interrupt_init (struct via_info *card)
  *
  */
 
-static struct file_operations via_dsp_fops = {
+static const struct file_operations via_dsp_fops = {
        .owner          = THIS_MODULE,
        .open           = via_dsp_open,
        .release        = via_dsp_release,
@@ -2105,6 +2104,7 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma,
 {
        struct via_info *card = vma->vm_private_data;
        struct via_channel *chan = &card->ch_out;
+       unsigned long max_bufs;
        struct page *dmapage;
        unsigned long pgoff;
        int rd, wr;
@@ -2128,14 +2128,11 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma,
        rd = card->ch_in.is_mapped;
        wr = card->ch_out.is_mapped;
 
-#ifndef VIA_NDEBUG
-       {
-       unsigned long max_bufs = chan->frag_number;
-       if (rd && wr) max_bufs *= 2;
-       /* via_dsp_mmap() should ensure this */
-       assert (pgoff < max_bufs);
-       }
-#endif
+       max_bufs = chan->frag_number;
+       if (rd && wr)
+               max_bufs *= 2;
+       if (pgoff >= max_bufs)
+               return NOPAGE_SIGBUS;
 
        /* if full-duplex (read+write) and we have two sets of bufs,
         * then the playback buffers come first, sez soundcard.c */