]> git.hungrycats.org Git - linux/commitdiff
[PATCH] swap file missing error check
authorDave Jones <davej@suse.de>
Thu, 9 May 2002 04:44:43 +0000 (21:44 -0700)
committerDave Jones <davej@suse.de>
Thu, 9 May 2002 04:44:43 +0000 (21:44 -0700)
Found by Andries Brouwer a while back iirc.

mm/swapfile.c

index 2ced3aaa6a4675961877e96355bfc5096daaf9e6..0c49a1481ddbd7bbdf52cf2fcccb4ddb60ffd39a 100644 (file)
@@ -1088,7 +1088,7 @@ bad_swap_2:
        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)