From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Chenghai Huang <huangchenghai2@huawei.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Sasha Levin <sashal@kernel.org>,
qianweili@huawei.com, wangzhou1@hisilicon.com,
davem@davemloft.net, linux-crypto@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 05/11] crypto: hisilicon/qm - Add the err memory release process to qm uninit
Date: Sun, 26 May 2024 05:42:43 -0400 [thread overview]
Message-ID: <20240526094251.3413178-5-sashal@kernel.org> (raw)
In-Reply-To: <20240526094251.3413178-1-sashal@kernel.org>
From: Chenghai Huang <huangchenghai2@huawei.com>
[ Upstream commit c9ccfd5e0ff0dd929ce86d1b5f3c6a414110947a ]
When the qm uninit command is executed, the err data needs to
be released to prevent memory leakage. The error information
release operation and uacce_remove are integrated in
qm_remove_uacce.
So add the qm_remove_uacce to qm uninit to avoid err memory
leakage.
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/hisilicon/qm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
index e889363ed978e..562df5c77c636 100644
--- a/drivers/crypto/hisilicon/qm.c
+++ b/drivers/crypto/hisilicon/qm.c
@@ -2952,12 +2952,9 @@ void hisi_qm_uninit(struct hisi_qm *qm)
hisi_qm_set_state(qm, QM_NOT_READY);
up_write(&qm->qps_lock);
+ qm_remove_uacce(qm);
qm_irqs_unregister(qm);
hisi_qm_pci_uninit(qm);
- if (qm->use_sva) {
- uacce_remove(qm->uacce);
- qm->uacce = NULL;
- }
}
EXPORT_SYMBOL_GPL(hisi_qm_uninit);
--
2.43.0
next prev parent reply other threads:[~2024-05-26 9:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-26 9:42 [PATCH AUTOSEL 6.6 01/11] fs/writeback: bail out if there is no more inodes for IO and queued once Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 02/11] md: Fix overflow in is_mddev_idle Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 03/11] padata: Disable BH when taking works lock on MT path Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 04/11] crypto: hisilicon/sec - Fix memory leak for sec resource release Sasha Levin
2024-05-26 9:42 ` Sasha Levin [this message]
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 06/11] io_uring/sqpoll: work around a potential audit memory leak Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 07/11] rcutorture: Fix rcu_torture_one_read() pipe_count overflow comment Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 08/11] rcutorture: Make stall-tasks directly exit when rcutorture tests end Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 09/11] rcutorture: Fix invalid context warning when enable srcu barrier testing Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 10/11] binfmt_elf: Leave a gap between .bss and brk Sasha Levin
2024-05-26 9:42 ` [PATCH AUTOSEL 6.6 11/11] block/ioctl: prefer different overflow check Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240526094251.3413178-5-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=huangchenghai2@huawei.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qianweili@huawei.com \
--cc=stable@vger.kernel.org \
--cc=wangzhou1@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox