diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-03-03 13:54:21 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:41:28 -0400 |
commit | 182fe5abd8ebbb3a00c1be91f44e4783e139918c (patch) | |
tree | 7404993656166f2b7cb78e54e4275d44336ba27c /fs/gfs2/ops_address.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/ops_address.c')
-rw-r--r-- | fs/gfs2/ops_address.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c index fbb4a6aa1583..2483d8741060 100644 --- a/fs/gfs2/ops_address.c +++ b/fs/gfs2/ops_address.c | |||
@@ -649,6 +649,10 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping, | |||
649 | 649 | ||
650 | if (alloc_required) { | 650 | if (alloc_required) { |
651 | al = gfs2_alloc_get(ip); | 651 | al = gfs2_alloc_get(ip); |
652 | if (!al) { | ||
653 | error = -ENOMEM; | ||
654 | goto out_unlock; | ||
655 | } | ||
652 | 656 | ||
653 | error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); | 657 | error = gfs2_quota_lock(ip, NO_QUOTA_CHANGE, NO_QUOTA_CHANGE); |
654 | if (error) | 658 | if (error) |