libwd/0014-uadk-mempool-check-stats-null-pointer.patch
Yang Shen bd84f97fbf libwd: backport for uadk from 2.3.21 to 2.3.24
Update some patch for uadk from mainline.
To get more infomation, please visit the homepage:
https://github.com/Linaro/uadk

Signed-off-by: Yang Shen <shenyang39@huawei.com>
2022-01-10 08:56:20 +00:00

33 lines
789 B
Diff

From 80fd67d79a66c45171890460ed8a8cc8bc83bb7a Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Thu, 30 Dec 2021 12:07:28 +0800
Subject: [PATCH 16/28] uadk: mempool: check stats null pointer
If user input's stats is null pointer, it will cause
a segment fault, fix it.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
---
wd_mempool.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/wd_mempool.c b/wd_mempool.c
index bbf5edb..b6e1088 100644
--- a/wd_mempool.c
+++ b/wd_mempool.c
@@ -958,6 +958,11 @@ void wd_mempool_stats(handle_t mempool, struct wd_mempool_stats *stats)
return;
}
+ if (!stats) {
+ WD_ERR("wd_mempool: mempool stats is NULL\n");
+ return;
+ }
+
wd_spinlock(&mp->lock);
stats->page_type = mp->page_type;
--
2.31.1