lkml.org 
[lkml]   [2002]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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 13:15    [W:0.033 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site