cifs: fix use-after-free bug in find_writable_file
[pandora-kernel.git] / fs / cifs / file.c
index aa05d5e..f9d2863 100644 (file)
@@ -1608,6 +1608,7 @@ refind_writable:
                        cifsFileInfo_put(inv_file);
                        spin_lock(&cifs_file_list_lock);
                        ++refind;
+                       inv_file = NULL;
                        goto refind_writable;
                }
        }