summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-02-23 19:48:01 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-02-23 21:40:16 +0100
commitb08eb91df132e84fa41b4cf06707629b2c5c895e (patch)
tree07a61cef51679e67709048e910581f2a9cfcf748
parent2e168a52b07bb9dc659bdcda80fc77031edebbd6 (diff)
downloadlvm2-b08eb91df132e84fa41b4cf06707629b2c5c895e.tar.gz
coverity: check for info pointer existance
Since we already check in few other places 'info' is not NULL, do the same for others - however when info would be NULL it more or less looks like internal error.
-rw-r--r--lib/cache/lvmetad.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index b68e6c938..a483e04e3 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1062,14 +1062,16 @@ int lvmetad_pv_found(const struct id *pvid, struct device *dev, const struct for
return_0;
}
+ /* TODO: resolve what does it actually mean 'info == NULL'
+ * missing info is likely an INTERNAL_ERROR */
if (!config_make_nodes(pvmeta, pvmeta->root, NULL,
"device = %"PRId64, (int64_t) dev->dev,
"dev_size = %"PRId64, (int64_t) (info ? lvmcache_device_size(info) : 0),
"format = %s", fmt->name,
"label_sector = %"PRId64, (int64_t) label_sector,
"id = %s", uuid,
- "ext_version = %"PRId64, (int64_t) lvmcache_ext_version(info),
- "ext_flags = %"PRId64, (int64_t) lvmcache_ext_flags(info),
+ "ext_version = %"PRId64, (int64_t) (info ? lvmcache_ext_version(info) : 0),
+ "ext_flags = %"PRId64, (int64_t) (info ? lvmcache_ext_flags(info) : 0),
NULL))
{
dm_config_destroy(pvmeta);