2001-07-24 23:10:44

by Anton Altaparmakov

[permalink] [raw]
Subject: [PATCH] And another small ntfs fix

Linus,

Please apply below patch. It is incremental to patch before previous one.

Fixes a truly silly bug reported by the Stanford Checker, where we
dereference an inode pointer and then check for it not being NULL
afterwards...

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

------ cut here -------
--- linux-2.4.7-pre8-vanilla/fs/ntfs/dir.c.old Wed Jul 25 00:03:57 2001
+++ linux-2.4.7-pre8-vanilla/fs/ntfs/dir.c Wed Jul 25 00:04:40 2001
@@ -789,7 +789,7 @@
int block;
int start;
ntfs_attribute *attr;
- ntfs_volume *vol = ino->vol;
+ ntfs_volume *vol;
int byte, bit;
int error = 0;

@@ -797,6 +797,7 @@
ntfs_error("No inode passed to getdir_unsorted\n");
return -EINVAL;
}
+ vol = ino->vol;
if (!vol) {
ntfs_error("Inode %d has no volume\n", ino->i_number);
return -EINVAL;