summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-11-29 15:50:21 +0300
committerJiri Slaby <jslaby@suse.cz>2015-01-07 16:24:10 +0100
commitf55c16cdf8a425447bf529756e3b5d895fc2d1e9 (patch)
treefafab52cce848db87fb94dba736b62f0eb80d041
parent4c0c560de59bf1f8a97bf76086c15c70dd3181db (diff)
downloadlinux-stable-f55c16cdf8a425447bf529756e3b5d895fc2d1e9.tar.gz
linux-stable-f55c16cdf8a425447bf529756e3b5d895fc2d1e9.tar.bz2
linux-stable-f55c16cdf8a425447bf529756e3b5d895fc2d1e9.zip
dm space map metadata: fix sm_bootstrap_get_nr_blocks()
commit c1c6156fe4d4577444b769d7edd5dd503e57bbc9 upstream. This function isn't right and it causes a static checker warning: drivers/md/dm-thin.c:3016 maybe_resize_data_dev() error: potentially using uninitialized 'sb_data_size'. It should set "*count" and return zero on success the same as the sm_metadata_get_nr_blocks() function does earlier. Fixes: 3241b1d3e0aa ('dm: add persistent data library') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--drivers/md/persistent-data/dm-space-map-metadata.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/persistent-data/dm-space-map-metadata.c b/drivers/md/persistent-data/dm-space-map-metadata.c
index 579b58200bf2..d9a5aa532017 100644
--- a/drivers/md/persistent-data/dm-space-map-metadata.c
+++ b/drivers/md/persistent-data/dm-space-map-metadata.c
@@ -564,7 +564,9 @@ static int sm_bootstrap_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count
{
struct sm_metadata *smm = container_of(sm, struct sm_metadata, sm);
- return smm->ll.nr_blocks;
+ *count = smm->ll.nr_blocks;
+
+ return 0;
}
static int sm_bootstrap_get_nr_free(struct dm_space_map *sm, dm_block_t *count)