hwdb: fix error check of wrong variable (#4499)

We updated 'fn' but checked 'v' instead.

From 698c5a17

Spotted with PVS
This commit is contained in:
Thomas H. P. Andersen 2016-10-27 03:22:26 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent a5eebcff37
commit 342d3ac165

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