]> 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>
Wed, 3 Aug 2011 00:52:38 +0000 (10:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 15 Aug 2011 04:44:07 +0000 (14:44 +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 15fceefbca0a02b9d1c9ddf3a4da224228c2ec40..bb85e484da08b40187bf2088fd43a27b42f7cd30 100644 (file)
@@ -1863,7 +1863,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;
                }