lkml.org 
[lkml]   [2001]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject__get_swap_page() minor problem

Hi,

If the check for "count >= SWAP_MAP_MAX" in __get_swap_page is true, we
will end up trying to unlock a not-yet-locked spinlock.

Here goes a patch to change this.

--- linux/mm/swapfile.c.orig Thu Jan 4 04:10:08 2001
+++ linux/mm/swapfile.c Thu Jan 4 04:10:12 2001
@@ -90,8 +90,12 @@
int type, wrapped = 0;

entry.val = 0; /* Out of memory */
- if (count >= SWAP_MAP_MAX)
- goto bad_count;
+ if (count >= SWAP_MAP_MAX) {
+ printk(KERN_ERR "get_swap_page: bad count %hd from %p\n",
+ count, __builtin_return_address(0));
+ return entry;
+ }
+
swap_list_lock();
type = swap_list.next;
if (type < 0)
@@ -130,11 +134,6 @@
out:
swap_list_unlock();
return entry;
-
-bad_count:
- printk(KERN_ERR "get_swap_page: bad count %hd from %p\n",
- count, __builtin_return_address(0));
- goto out;
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.029 / U:4.372 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site