[PATCH] 2.4.21-pre5-ac3: swapoff on a not attached swapfile

Szabolcs Berecz (szabi@mplayerhq.hu)
Sun, 13 Apr 2003 00:29:58 +0200 (CEST)


When swapoff is called with a swapfile which is not attached, it calls
path_release with uninitialized struct nameidata.

Bye,
Szabi

--- linux-2.4.21-pre5-ac3/mm/swapfile.c.orig Sat Apr 12 15:03:02 2003
+++ linux-2.4.21-pre5-ac3/mm/swapfile.c Sat Apr 12 23:03:47 2003
@@ -742,7 +742,7 @@
err = -EINVAL;
if (type < 0) {
swap_list_unlock();
- goto out_dput;
+ goto out_dput_no_nd;
}

if (prev < 0) {
@@ -798,8 +798,9 @@
err = 0;

out_dput:
- unlock_kernel();
path_release(&nd);
+out_dput_no_nd:
+ unlock_kernel();
filp_close(victim, NULL);
out:
putname(tmp);

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