aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-03-03 13:54:21 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2008-03-31 05:41:28 -0400
commit182fe5abd8ebbb3a00c1be91f44e4783e139918c (patch)
tree7404993656166f2b7cb78e54e4275d44336ba27c /fs/gfs2/eattr.c
parent105284970ba7d0d0ff4b97e57728eac7adf6a42a (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/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,
318 int error; 318 int error;
319 319
320 al = gfs2_alloc_get(ip); 320 al = gfs2_alloc_get(ip);
321 if (!al)
322 return -ENOMEM;
321 323
322 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 324 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
323 if (error) 325 if (error)
@@ -681,6 +683,8 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er,
681 int error; 683 int error;
682 684
683 al = gfs2_alloc_get(ip); 685 al = gfs2_alloc_get(ip);
686 if (!al)
687 return -ENOMEM;
684 688
685 error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 689 error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
686 if (error) 690 if (error)
@@ -1464,6 +1468,8 @@ int gfs2_ea_dealloc(struct gfs2_inode *ip)
1464 int error; 1468 int error;
1465 1469
1466 al = gfs2_alloc_get(ip); 1470 al = gfs2_alloc_get(ip);
1471 if (!al)
1472 return -ENOMEM;
1467 1473
1468 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); 1474 error = gfs2_quota_hold(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE);
1469 if (error) 1475 if (error)