Skip to contentSkip to conversation

master - cov: fix error path

PATCH Zdenek Kabelac 1 participant 1 message Oct 15, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=253989ecd953b1afcaea43fa0515c55bc6533cd2
Commit:        253989ecd953b1afcaea43fa0515c55bc6533cd2
Parent:        13c49033ede4bb57878361e5ae04c96d4930e9fa
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Oct 15 15:20:45 2018 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Oct 15 17:49:44 2018 +0200

cov: fix error path

Avoid calling 'bad:' section since we have not set 'fd' yet and instead directly return failing 0 value.

---
 lib/metadata/vdo_manip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/metadata/vdo_manip.c +1 -1
index 0b3ed19..c0446ad 100644
@@ -102,7 +102,7 @@ static int _sysfs_get_kvdo_value(const char *dm_name, const char *vdo_param, uin
 	if (dm_snprintf(path, sizeof(path), "%skvdo/%s/%s",
 			dm_sysfs_dir(), dm_name, vdo_param) < 0) {
 		log_error("Failed to build kmod path.");
-		goto bad;
+		return 0;
 	}
 
 	if ((fd = open(path, O_RDONLY)) < 0) {