From f86c1f5d0a38afc9d174e59af4bab83127e4b2b8 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Wed, 29 Mar 2017 17:39:31 +0100 Subject: [PATCH] libdm: abort filemap update if pool allocation fails (coverity) --- libdm/libdm-stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c index 5041d6112..94696fbcb 100644 --- a/libdm/libdm-stats.c +++ b/libdm/libdm-stats.c @@ -4540,8 +4540,9 @@ static int _stats_unmap_regions(struct dm_stats *dms, uint64_t group_id, ext.id = i; nr_kept++; - dm_pool_grow_object(mem, &ext, - sizeof(ext)); + if (!dm_pool_grow_object(mem, &ext, sizeof(ext))) + goto out; + log_very_verbose("Kept region " FMTu64, i); } else {