random: ctr_drbg: Fix the error path in sys_csrand_get
When ctr_drbg_initialize fails the function returns without unlock irq that was previously locked. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
6ac3d0b5b1
commit
b6ef0c0d94
1 changed files with 3 additions and 2 deletions
|
@ -112,7 +112,8 @@ int z_impl_sys_csrand_get(void *dst, uint32_t outlen)
|
|||
if (unlikely(!entropy_driver)) {
|
||||
ret = ctr_drbg_initialize();
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
ret = -EIO;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,8 +151,8 @@ int z_impl_sys_csrand_get(void *dst, uint32_t outlen)
|
|||
} else {
|
||||
ret = -EIO;
|
||||
}
|
||||
end:
|
||||
#endif
|
||||
end:
|
||||
irq_unlock(key);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue