Commit 0ebd1760 authored by Dave Jones's avatar Dave Jones

[PATCH] swap file missing error check

Found by Andries Brouwer a while back iirc.
parent 3f0501fe
......@@ -1088,7 +1088,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment