summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorTsutomu Itoh2011-02-01 10:17:35 +0100
committerChris Mason2011-02-01 13:16:37 +0100
commit5df67083488ccbad925f583b698ab38f8629a016 (patch)
treeec428f27f1b72c4d8e284831d4bef8894b2b8457 /fs/btrfs/tree-log.c
parentBtrfs: avoid uninit variable warnings in ordered-data.c (diff)
downloadkernel-qcow2-linux-5df67083488ccbad925f583b698ab38f8629a016.tar.gz
kernel-qcow2-linux-5df67083488ccbad925f583b698ab38f8629a016.tar.xz
kernel-qcow2-linux-5df67083488ccbad925f583b698ab38f8629a016.zip
btrfs: checking NULL or not in some functions
Because NULL is returned when the memory allocation fails, it is checked whether it is NULL. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 42dfc3077040..6d66e5caff97 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2751,7 +2751,13 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
log = root->log_root;
path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
dst_path = btrfs_alloc_path();
+ if (!dst_path) {
+ btrfs_free_path(path);
+ return -ENOMEM;
+ }
min_key.objectid = inode->i_ino;
min_key.type = BTRFS_INODE_ITEM_KEY;