4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-30 02:51:33 +08:00

Merge pull request #3453 from DavidLin1577/patch-6

[bsp]Fixed a  stack overflow bug in drv_crypto.c
This commit is contained in:
Bernard Xiong 2020-03-15 20:39:48 +08:00 committed by GitHub
commit 6d3c0be646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,6 +168,11 @@ static rt_err_t _crypto_create(struct rt_hwcrypto_ctx *ctx)
case HWCRYPTO_TYPE_RNG:
{
RNG_HandleTypeDef *hrng = rt_calloc(1, sizeof(RNG_HandleTypeDef));
if (RT_NULL == hrng)
{
res = -RT_ERROR;
break;
}
hrng->Instance = RNG;
HAL_RNG_Init(hrng);