patch-2.3.9 linux/arch/mips/jazz/jazzdma.c

Next file: linux/arch/mips/jazz/kbd-jazz.c
Previous file: linux/arch/mips/jazz/int-handler.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.8/linux/arch/mips/jazz/jazzdma.c linux/arch/mips/jazz/jazzdma.c
@@ -97,6 +97,7 @@
     unsigned int frame;
     unsigned long laddr;
     int i;
+    unsigned long flags;
 
     /* check arguments */
   
@@ -113,6 +114,7 @@
         return VDMA_ERROR;	/* invalid physical address */
     }
   
+    save_and_cli (flags);
     /*
      * Find free chunk
      */
@@ -123,8 +125,10 @@
         while (entry[first].owner != VDMA_PAGE_EMPTY &&
                first < VDMA_PGTBL_ENTRIES)
             first++;
-        if (first+pages > VDMA_PGTBL_ENTRIES) /* nothing free */
+        if (first+pages > VDMA_PGTBL_ENTRIES) { /* nothing free */
+	    restore_flags (flags);
             return VDMA_ERROR;
+	}
 
         last = first+1;
         while (entry[last].owner == VDMA_PAGE_EMPTY && last-first < pages)
@@ -170,6 +174,7 @@
         printk("\n");
     }
   
+    restore_flags(flags);
     return laddr;
 }
 

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