提交 f1d48e52 编写于 作者: T Tang Yizhou 提交者: Yang Yingliang

share_pool: Fix missing semaphore operation in error branch

ascend inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI
CVE: NA

-------------------------------------------------

Increase the value of sp_stat_sem when failed.
Signed-off-by: NTang Yizhou <tangyizhou@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f7099f7b
...@@ -135,6 +135,7 @@ static struct sp_proc_stat *sp_init_proc_stat(struct task_struct *tsk, ...@@ -135,6 +135,7 @@ static struct sp_proc_stat *sp_init_proc_stat(struct task_struct *tsk,
up_write(&sp_stat_sem); up_write(&sp_stat_sem);
return stat; return stat;
} else { } else {
up_write(&sp_stat_sem);
/* if enter this branch, that's our mistake */ /* if enter this branch, that's our mistake */
pr_err_ratelimited("share pool: proc stat invalid id %d\n", id); pr_err_ratelimited("share pool: proc stat invalid id %d\n", id);
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册