diff options
author | Dan Carpenter <error27@gmail.com> | 2009-11-10 10:01:43 +0100 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-11-11 20:20:18 +0100 |
commit | 4eb3991c5def39bcf553c14ebe2618fcb47b627f (patch) | |
tree | 9c35f532bd29e68014cc16dc6e528a8cca5cfe34 /fs/btrfs | |
parent | Btrfs: skip btrfs_release_path in btrfs_update_root and btrfs_del_root (diff) | |
download | linux-4eb3991c5def39bcf553c14ebe2618fcb47b627f.tar.xz linux-4eb3991c5def39bcf553c14ebe2618fcb47b627f.zip |
Btrfs: avoid null deref in unpin_extent_cache()
I re-orderred the checks to avoid dereferencing "em" if it was null.
Found by smatch static checker.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent_map.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 2c726b7b9faa..ccbdcb54ec5d 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -208,7 +208,7 @@ int unpin_extent_cache(struct extent_map_tree *tree, u64 start, u64 len) write_lock(&tree->lock); em = lookup_extent_mapping(tree, start, len); - WARN_ON(em->start != start || !em); + WARN_ON(!em || em->start != start); if (!em) goto out; |