From 99e96f3ce9d14e30b7150d3d4614cf9ab810e264 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 21 Apr 2016 20:19:24 +0200 Subject: [PATCH] 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. --- WHATS_NEW | 1 + lib/activate/dev_manager.c | 6 +++--- 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))