]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hwdb: fix error check of wrong variable (#4499)
authorThomas H. P. Andersen <phomes@gmail.com>
Thu, 27 Oct 2016 01:22:26 +0000 (03:22 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 27 Oct 2016 01:22:26 +0000 (21:22 -0400)
We updated 'fn' but checked 'v' instead.

From 698c5a17

Spotted with PVS

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 = {