diff options
author | Hridya Valsaraju <hridya@google.com> | 2018-01-29 14:11:39 -0800 |
---|---|---|
committer | Hridya Valsaraju <hridya@google.com> | 2018-01-31 19:13:41 +0000 |
commit | 9ec4bdabb790b0ddbb627c86830569a809121000 (patch) | |
tree | 6e543fbd9b9cba63d39222a30441eddc84ca86b3 /ufdt_convert.c | |
parent | 204e2ddbc8b2b5e7bab368bef5ee2922be57b6d3 (diff) | |
download | libufdt-9ec4bdabb790b0ddbb627c86830569a809121000.tar.gz |
Fix bug in ufdt_get_node_by_phandle
Bug:67779848
Test: mm
If the phandle being searched for exceeded the highest phandle
in phandle_table.data, the bug was causing the return of the node
corresponding to the highest phandle in phandle_table.data.
Change-Id: I731c820b0c4bfe75a14cc1d22a34262b9905f365
Diffstat (limited to 'ufdt_convert.c')
-rw-r--r-- | ufdt_convert.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ufdt_convert.c b/ufdt_convert.c index 9d7c698..5c69f1f 100644 --- a/ufdt_convert.c +++ b/ufdt_convert.c @@ -230,7 +230,7 @@ struct ufdt_node *ufdt_get_node_by_phandle(struct ufdt *tree, else s = mid; } - if (e - s > 0) { + if (e - s > 0 && tree->phandle_table.data[s].phandle == phandle) { res = tree->phandle_table.data[s].node; } return res; |