summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-04-21 20:19:24 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-04-22 01:12:34 +0200
commit99e96f3ce9d14e30b7150d3d4614cf9ab810e264 (patch)
tree7bba08751ca87e9f2948bf34d33ecaf52adf31f1
parentcbf99be43a70e872b5040ffa0193a8f4961a7068 (diff)
downloadlvm2-99e96f3ce9d14e30b7150d3d4614cf9ab810e264.tar.gz
coverity: fix error paths
Patch 74e704bb4465960b361711c890733cbae1f06e42 missed to update error path. Since now we just need to 'return_0' as 'dmt is NULL and thus may not be destroyed.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/activate/dev_manager.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index ffc83f51f..d08856097 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.151 -
=================================
+ Fix error path after reusing of _setup_task (2.02.150).
Fix memory access for empty sysfs values (2.02.149).
Disable lvmetad when lvm1 metadata is seen, so commands revert to scanning.
Suppress errors when snapshot merge gets delayed because volume is in use.
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 5b1e22657..c07af2d1a 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -381,7 +381,7 @@ static int _device_is_suspended(int major, int minor)
if (!(dmt = _setup_task(NULL, NULL, NULL, DM_DEVICE_INFO,
major, minor, 0)))
- goto_out;
+ return_0;
if (!dm_task_run(dmt) ||
!dm_task_get_info(dmt, &info)) {
@@ -406,7 +406,7 @@ static int _ignore_suspended_snapshot_component(struct device *dev)
if (!(dmt = _setup_task(NULL, NULL, NULL, DM_DEVICE_TABLE,
MAJOR(dev->dev), MINOR(dev->dev), 0)))
- goto_out;
+ return_0;
if (!dm_task_run(dmt)) {
log_error("Failed to get state of snapshot or snapshot origin device");
@@ -529,7 +529,7 @@ int device_is_usable(struct device *dev, struct dev_usable_check_params check)
if (!(dmt = _setup_task(NULL, NULL, NULL, DM_DEVICE_STATUS,
MAJOR(dev->dev), MINOR(dev->dev), 0)))
- goto_out;
+ return_0;
/* Non-blocking status read */
if (!dm_task_no_flush(dmt))