]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/hwdb/hwdb.c
hwdb: fix error check of wrong variable (#4499)
[thirdparty/systemd.git] / src / hwdb / hwdb.c
index be4ef5f9e9a0065201cd32e52c9706d232177d22..ab1feb435b145bb6ad6ebd6a38e95da0df0194ae 100644 (file)
@@ -172,8 +172,8 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
         if (v < 0)
                 return v;
         fn = strbuf_add_string(trie->strings, filename, strlen(filename));
-        if (v < 0)
-                return v;
+        if (fn < 0)
+                return fn;
 
         if (node->values_count) {
                 struct trie_value_entry search = {