浏览代码

Btrfs: fix a potential btrfs_bio leak on scrub fixups

In case we were able to map less than we wanted (length < PAGE_SIZE
clause is true) btrfs_bio is still allocated and we have to free it.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Ilya Dryomov 13 年之前
父节点
当前提交
56d2a48f81
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/btrfs/scrub.c

+ 1 - 0
fs/btrfs/scrub.c

@@ -655,6 +655,7 @@ static void scrub_fixup(struct scrub_bio *sbio, int ix)
 		       "scrub_fixup: btrfs_map_block failed us for %llu\n",
 		       "scrub_fixup: btrfs_map_block failed us for %llu\n",
 		       (unsigned long long)logical);
 		       (unsigned long long)logical);
 		WARN_ON(1);
 		WARN_ON(1);
+		kfree(bbio);
 		return;
 		return;
 	}
 	}