]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Don't dereference em if it's NULL or an error pointer.
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 26 Jul 2011 10:14:43 +0000 (20:14 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 1 Aug 2011 03:36:30 +0000 (13:36 +1000)
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/btrfs/inode.c

index 13e6255182e3dad59af5463537dbc21abdff4bef..16581b538308c9c7e805106d80513b06e29c2b83 100644 (file)
@@ -1865,7 +1865,8 @@ static int btrfs_io_failed_hook(struct bio *failed_bio,
 
                read_lock(&em_tree->lock);
                em = lookup_extent_mapping(em_tree, start, failrec->len);
-               if (em->start > start || em->start + em->len < start) {
+               if (em && !IS_ERR(em) && (em->start > start ||
+                                       em->start + em->len < start)) {
                        free_extent_map(em);
                        em = NULL;
                }