summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Ye <yekai13@huawei.com>2021-08-13 15:41:01 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-08-21 15:44:57 +0800
commit90367a027a22c3a9ca8b8bac15df34d9e859fc11 (patch)
tree2e22f4dbc548282b083c1e8b70e668e08d785321
parent598cf42554749a7c59205879fd6e06ef6d021d94 (diff)
crypto: hisilicon/sec - fix the abnormal exiting process
Because the algs registration process has added a judgment. So need to add the judgment for the abnormal exiting process. Signed-off-by: Kai Ye <yekai13@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/hisilicon/sec2/sec_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c
index db4dbcf0492a..45a1ddd31dc3 100644
--- a/drivers/crypto/hisilicon/sec2/sec_main.c
+++ b/drivers/crypto/hisilicon/sec2/sec_main.c
@@ -1020,7 +1020,8 @@ static int sec_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return 0;
err_alg_unregister:
- hisi_qm_alg_unregister(qm, &sec_devices);
+ if (qm->qp_num >= ctx_q_num)
+ hisi_qm_alg_unregister(qm, &sec_devices);
err_qm_stop:
sec_debugfs_exit(qm);
hisi_qm_stop(qm, QM_NORMAL);