Commit:     5bc98594d59672303c4c9c07262ecc373dc374da
Parent:     cfce66047f1893cb7d3abb0d53e65cbbd8d605f0
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 14:50:18 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon May 7 12:12:57 2007 -0700

    hugetlbfs: add NULL check in hugetlb_zero_setup()
    If hugetlbfs module_init() fails, hugetlbfs_vfsmount is not initialized and
    shmget() with SHM_HUGETLB flag will cause NULL pointer dereference.
    Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
    Acked-by: William Irwin <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/hugetlbfs/inode.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 842a4ed..98959b8 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -747,6 +747,9 @@ struct file *hugetlb_zero_setup(size_t size)
        char buf[16];
        static atomic_t counter;
+       if (!hugetlbfs_vfsmount)
+               return ERR_PTR(-ENOENT);
        if (!can_do_hugetlb_shm())
                return ERR_PTR(-EPERM);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to