diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2016-05-17 17:37:38 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-07 18:18:55 -0700 |
commit | f8f2b9dd9ccb165fa472855ef98e624e3173f8dd (patch) | |
tree | 3152991fcc4357e324bb12b9b24b0b3e5410f780 /lib/kstrtox.c | |
parent | 327b1cf89e87607cf1d999a27481245b2610149c (diff) | |
download | lwn-f8f2b9dd9ccb165fa472855ef98e624e3173f8dd.tar.gz lwn-f8f2b9dd9ccb165fa472855ef98e624e3173f8dd.zip |
btrfs: scrub: Set bbio to NULL before calling btrfs_map_block
commit f1fee6534dcfbf468a159789aa202db2bce8c200 upstream.
We usually call btrfs_put_bbio() when btrfs_map_block() failed,
btrfs_put_bbio() works right whether bbio is a valid value, or NULL.
But there is a exception, in some case, btrfs_map_block() will return
fail without touching *bbio(keeping its original value), and if bbio
was not initialized yet, invalid memory accessing will happened.
Above case is in scrub_missing_raid56_pages(), and similar case in
scrub_raid56_parity().
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/kstrtox.c')
0 files changed, 0 insertions, 0 deletions