avoid null deref in unpin_extent_cache()
PATCH 1/1 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.
regards,
dan carpenter
Signed-off-by Dan Carpenter <[email protected]>
fs/btrfs/extent_map.c +1 -1
@@ -208,7 +208,7 @@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;
Quoted 1 line · Dan Carpenter
I re-orderred the checks to avoid dereferencing "em" if it was null.
Thanks, I've put this into the master branch of the btrfs unstable tree.
-chris