From 53e92441a613270750c12089b119337a71ff545a Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 5 Jul 2016 18:33:02 +0100 Subject: [PATCH] libdm: fix in dm_stats_get_nr_regions --- libdm/libdm-stats.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 93b8e0b06..ab155896b 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -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; } -- 2.43.5