代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpdk 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 08ad2bc6e7fd4bc11b25011dbae48268828d372f Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen@huawei.com>
Date: Mon, 6 Feb 2023 10:53:11 +0000
Subject: raw/ifpga/base: fix init with multi-process
[ upstream commit e6a2804b77c5fbfd97d0fe05ec7f959a0404a380 ]
The MAP_FAILED should be used to determine whether the mapping is
successful.
Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
---
drivers/raw/ifpga/base/opae_hw_api.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/raw/ifpga/base/opae_hw_api.c b/drivers/raw/ifpga/base/opae_hw_api.c
index 11c9887c7f..45efe70473 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.c
+++ b/drivers/raw/ifpga/base/opae_hw_api.c
@@ -380,7 +380,7 @@ static pthread_mutex_t *opae_adapter_mutex_open(struct opae_adapter *adapter)
PROT_READ | PROT_WRITE, MAP_SHARED,
shm_id, 0);
adapter->lock = (pthread_mutex_t *)ptr;
- if (ptr) {
+ if (ptr != MAP_FAILED) {
dev_info(NULL,
"shared memory %s address is %p\n",
shm_name, ptr);
@@ -499,7 +499,7 @@ static void *opae_adapter_shm_alloc(struct opae_adapter *adapter)
adapter->shm.size = size;
adapter->shm.ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_SHARED, shm_id, 0);
- if (adapter->shm.ptr) {
+ if (adapter->shm.ptr != MAP_FAILED) {
dev_info(NULL,
"shared memory %s address is %p\n",
shm_name, adapter->shm.ptr);
--
2.23.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。