Btrfs: confirmation of value is added before trace_btrfs_get_extent() is called
diff mbox

Message ID 201210010908.AA00013@FM-323941448.jp.fujitsu.com
State New, archived
Headers show

Commit Message

Tsutomu Itoh Oct. 1, 2012, 9:08 a.m. UTC
We should confirm the value of extent_map before calling
trace_btrfs_get_extent() because the value of extent_map has the
possibility of NULL.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
---
 fs/btrfs/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index cad0c57..b8f53e8 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6123,7 +6123,8 @@  insert:
 	write_unlock(&em_tree->lock);
 out:
 
-	trace_btrfs_get_extent(root, em);
+	if (em)
+		trace_btrfs_get_extent(root, em);
 
 	if (path)
 		btrfs_free_path(path);