projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df66916
)
Btrfs: avoid null deref in unpin_extent_cache()
author
Dan Carpenter
<error27@gmail.com>
Tue, 10 Nov 2009 09:01:43 +0000
(09:01 +0000)
committer
Chris Mason
<chris.mason@oracle.com>
Wed, 11 Nov 2009 19:20:18 +0000
(14:20 -0500)
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>
fs/btrfs/extent_map.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/extent_map.c
b/fs/btrfs/extent_map.c
index 2c726b7b9faa17af725b8a5b8319148758b7dd91..ccbdcb54ec5d988f39690b33f9964c35da134e30 100644
(file)
--- 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;