master - libdm: fix <backtrace> in dm_stats_get_nr_regions
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=53e92441a613270750c12089b119337a71ff545a Commit: 53e92441a613270750c12089b119337a71ff545a Parent: cf0fa3d69319755be0d6fb0c7f692f89e49f5881 Author: Bryn M. Reeves <[email protected]> AuthorDate: Tue Jul 5 18:33:02 2016 +0100 Committer: Bryn M. Reeves <[email protected]> CommitterDate: Tue Jul 5 19:53:17 2016 +0100
libdm: fix <backtrace> in dm_stats_get_nr_regions
--- libdm/libdm-stats.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
libdm/libdm-stats.c +5 -1
@@ -2132,8 +2132,12 @@ void dm_stats_buffer_destroy(struct dm_stats *dms, char *buffer)uint64_t dm_stats_get_nr_regions (const struct dm_stats *dms) { -if (!dms || !dms->regions) +if (!dms) return_0; + +if (!dms->regions) +return 0 ; +return dms->nr_regions; }