Commit 2094c334fdebbcceddf21f97cb16b144707af56e
Committed by
Artem Bityutskiy
1 parent
625bf371c1
Exists in
master
and in
4 other branches
UBIFS: correct key comparison
The comparison was working, but more by accident than design. Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
fs/ubifs/tnc_misc.c
... | ... | @@ -480,8 +480,8 @@ |
480 | 480 | } |
481 | 481 | |
482 | 482 | /* Make sure the key of the read node is correct */ |
483 | - key_read(c, key, &key1); | |
484 | - if (memcmp(node + UBIFS_KEY_OFFSET, &key1, c->key_len)) { | |
483 | + key_read(c, node + UBIFS_KEY_OFFSET, &key1); | |
484 | + if (!keys_eq(c, key, &key1)) { | |
485 | 485 | ubifs_err("bad key in node at LEB %d:%d", |
486 | 486 | zbr->lnum, zbr->offs); |
487 | 487 | dbg_tnc("looked for key %s found node's key %s", |