diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-09 16:56:11 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-11-09 17:04:10 +0100 |
commit | 76b42901c08bd66df600f3ad82fc2f179a3abc8a (patch) | |
tree | 145badeddff52ced605fbae6b25d43efd865a480 | |
parent | b1215b7f8c60f9484b0d6c032b24ea7e029505b0 (diff) | |
download | lvm2-76b42901c08bd66df600f3ad82fc2f179a3abc8a.tar.gz |
cache: ensure there is no NULL str
Coverity is not smart enough to detect this case could never happen.
-rw-r--r-- | lib/metadata/cache_manip.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c index 12b6d666c..449d8dffa 100644 --- a/lib/metadata/cache_manip.c +++ b/lib/metadata/cache_manip.c @@ -79,7 +79,10 @@ int cache_set_mode(struct lv_segment *seg, const char *str) find_config_node(cmd, cmd->cft, allocation_cache_pool_cachemode_CFG)) id = allocation_cache_pool_cachemode_CFG; - str = find_config_tree_str(cmd, id, NULL); + if (!(str = find_config_tree_str(cmd, id, NULL))) { + log_error(INTERNAL_ERROR "Cache mode is not determined."); + return 0; + } } if (!strcmp(str, "writeback")) |