
24 Nov
2023
24 Nov
'23
11:19 a.m.
Use dlerror() to check whether any exception occurs during dlopen() execution. Signed-off-by: Qi Tao <taoqi10@huawei.com> --- wd_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wd_aead.c b/wd_aead.c index 87d61c3..a4662af 100644 --- a/wd_aead.c +++ b/wd_aead.c @@ -92,7 +92,7 @@ static int wd_aead_open_driver(void) return ret; wd_aead_setting.dlhandle = dlopen(lib_path, RTLD_NOW); - if (!wd_aead_setting.dlhandle) { + if (dlerror() || !wd_aead_setting.dlhandle) { WD_ERR("failed to open libhisi_sec.so, %s\n", dlerror()); return -WD_EINVAL; } -- 2.33.0