From 253989ecd953b1afcaea43fa0515c55bc6533cd2 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Oct 2018 15:20:45 +0200 Subject: [PATCH] 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c index 0b3ed1981..c0446adfe 100644 --- a/lib/metadata/vdo_manip.c +++ b/lib/metadata/vdo_manip.c @@ -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) {