]> git.baikalelectronics.ru Git - uboot.git/commit
lib: uuid: fix the test on RNG device presence
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 22 Oct 2021 15:05:47 +0000 (17:05 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 26 Oct 2021 19:26:45 +0000 (15:26 -0400)
commit7d81b7f61f1ad46826c8af02350748ceba48a394
tree18e7c7b88baaa6680219b9f17468c9198f70bd1b
parentdb397c1cc90878827a225a5e5bcf7ff8ebe36c97
lib: uuid: fix the test on RNG device presence

Correct the test on RNG device presence,when ret is equal to 0,
before to call dm_rng_read function.

Without this patch the RNG device is not used when present (when ret == 0)
or a data abort occurs in dm_rng_read when CONFIG_DM_RNG is activated but
the RNG device is not present in device tree (ret != 0 and devp = NULL).

Fixes: 674fc7fb5a66 ("lib: uuid: use RNG device if present")
CC: Matthias Brugger <mbrugger@suse.com>
CC: Torsten Duwe <duwe@suse.de>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/uuid.c