提交 dc81d1d4 编写于 作者: W Weili Qian 提交者: Zheng Zengkai

crypto: hisilicon/qm - fix missing put dfx access

mainline inclusion
from mainline-v6.1-rc1
commit 5afc904f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5T7AD
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5afc904f443de2afd31c4e0686ba178beede86fe

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

In function qm_cmd_write(), if function returns from
branch 'atomic_read(&qm->status.flags) == QM_STOP',
the got dfx access is forgotten to put.

Fixes: 607c191b ("crypto: hisilicon - support runtime PM for accelerator device")
Signed-off-by: NWeili Qian <qianweili@huawei.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NJiangshui Yang <yangjiangshui@h-partners.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: NYang Shen <shenyang39@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 12534fce
......@@ -2216,8 +2216,10 @@ static ssize_t qm_cmd_write(struct file *filp, const char __user *buffer,
return ret;
/* Judge if the instance is being reset. */
if (unlikely(atomic_read(&qm->status.flags) == QM_STOP))
return 0;
if (unlikely(atomic_read(&qm->status.flags) == QM_STOP)) {
ret = 0;
goto put_dfx_access;
}
if (count > QM_DBG_WRITE_LEN) {
ret = -ENOSPC;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册