* [PATCH] crypto: hisilicon/qm - fix missing put dfx access
@ 2022-08-27 10:27 Weili Qian
2022-09-02 11:02 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Weili Qian @ 2022-08-27 10:27 UTC (permalink / raw)
To: herbert; +Cc: linux-kernel, linux-crypto, wangzhou1, liulongfang
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: 607c191b371d ("crypto: hisilicon - support runtime PM for accelerator device")
Signed-off-by: Weili Qian <qianweili@huawei.com>
---
drivers/crypto/hisilicon/qm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index c180ad33d2f8..cf67fbd4181d 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -2203,8 +2203,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;
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: hisilicon/qm - fix missing put dfx access
2022-08-27 10:27 [PATCH] crypto: hisilicon/qm - fix missing put dfx access Weili Qian
@ 2022-09-02 11:02 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2022-09-02 11:02 UTC (permalink / raw)
To: Weili Qian; +Cc: linux-kernel, linux-crypto, wangzhou1, liulongfang
On Sat, Aug 27, 2022 at 06:27:37PM +0800, Weili Qian wrote:
> 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: 607c191b371d ("crypto: hisilicon - support runtime PM for accelerator device")
> Signed-off-by: Weili Qian <qianweili@huawei.com>
> ---
> drivers/crypto/hisilicon/qm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-02 11:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 10:27 [PATCH] crypto: hisilicon/qm - fix missing put dfx access Weili Qian
2022-09-02 11:02 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).