master - libdm: fix <backtrace> in dm_stats_get_nr_regions
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a9f1278b55b406de66cde0f26b77cbcf1f3796d1 Commit: a9f1278b55b406de66cde0f26b77cbcf1f3796d1 Parent: ced707df28a5950c26af9d5529a3c05e10bf217e 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:29:51 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; }