lkml.org 
[lkml]   [2002]   [Jan]   [30]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateWed, 30 Jan 2002 11:09:28 +0300
FromAndrey Panin <>
Subject[PATCH] fix sys_swapon() error handling in 2.5.2-dj6
Hi all,

error path in sys_swapon() can pass negative error code to filp_close() 
which generates an oops, oneliner patch attached.

Best regards.

-- 
Andrey Panin            | Embedded systems software engineer
pazke@orbita1.ru        | PGP key: wwwkeys.eu.pgp.netdiff -urN -X /usr/dontdiff /linux.vanilla/mm/swapfile.c /linux/mm/swapfile.c
--- /linux.vanilla/mm/swapfile.c	Wed Jan 30 01:07:49 2002
+++ /linux/mm/swapfile.c	Tue Jan 29 21:23:46 2002
@@ -1073,7 +1073,7 @@
 	swap_list_unlock();
 	if (swap_map)
 		vfree(swap_map);
-	if (swap_file)
+	if (swap_file && !IS_ERR(swap_file))
 		filp_close(swap_file, NULL);
 out:
 	if (swap_header)[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 11:15    [W:0.140 / U:0.260 seconds]
©2003-2008 Jasper Spaans