summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorCyrill Gorcunov2008-03-03 19:54:21 +0100
committerSteven Whitehouse2008-03-31 11:41:28 +0200
commit182fe5abd8ebbb3a00c1be91f44e4783e139918c (patch)
tree7404993656166f2b7cb78e54e4275d44336ba27c /fs/gfs2/eattr.c
parent[GFS2] Need to ensure that sector_t is 64bits for GFS2 (diff)
downloadkernel-qcow2-linux-182fe5abd8ebbb3a00c1be91f44e4783e139918c.tar.gz
kernel-qcow2-linux-182fe5abd8ebbb3a00c1be91f44e4783e139918c.tar.xz
kernel-qcow2-linux-182fe5abd8ebbb3a00c1be91f44e4783e139918c.zip
[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/eattr.c')
-rw-r--r--fs/gfs2/eattr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/gfs2/eattr.c b/fs/gfs2/eattr.c
index 76ead1acfcc7..288d5e6ad93a 100644
--- a/fs/gfs2/eattr.c
+++ b/fs/gfs2/eattr.c
@@ -318,6 +318,8 @@ static int ea_remove_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh,
int error;
al = gfs2_alloc_get(ip);
+ if (!al)
+ return -ENOMEM;
error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
if (error)
@@ -681,6 +683,8 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
int error;
al = gfs2_alloc_get(ip);
+ if (!al)
+ return -ENOMEM;
error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
if (error)
@@ -1464,6 +1468,8 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
int error;
al = gfs2_alloc_get(ip);
+ if (!al)
+ return -ENOMEM;
error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
if (error)