diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-03-03 21:54:21 +0300 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 10:41:28 +0100 |
commit | 182fe5abd8ebbb3a00c1be91f44e4783e139918c (patch) | |
tree | 7404993656166f2b7cb78e54e4275d44336ba27c /fs/gfs2/inode.c | |
parent | 105284970ba7d0d0ff4b97e57728eac7adf6a42a (diff) |
[GFS2] possible null pointer dereference fixup
gfs2_alloc_get may fail so we have to check it to prevent
NULL pointer dereference.
Signed-off-by: Cyrill Gorcunov <gorcunov@gamil.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r-- | fs/gfs2/inode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 92ea9afacb17..dcae2aa83f13 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -351,6 +351,8 @@ int gfs2_dinode_dealloc(struct gfs2_inode *ip) } al = gfs2_alloc_get(ip); + if (!al) + return -ENOMEM; error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); if (error) @@ -825,7 +827,8 @@ static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, int error; munge_mode_uid_gid(dip, &mode, &uid, &gid); - gfs2_alloc_get(dip); + if (!gfs2_alloc_get(dip)) + return -ENOMEM; error = gfs2_quota_lock(dip, uid, gid); if (error) @@ -860,6 +863,8 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name, int error; al = gfs2_alloc_get(dip); + if (!al) + return -ENOMEM; error = gfs2_quota_lock(dip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); if (error) |