]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: hisilicon/sec - fix the abnormal exiting process
authorKai Ye <yekai13@huawei.com>
Fri, 13 Aug 2021 07:41:01 +0000 (15:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:30 +0000 (10:00 +0200)
[ Upstream commit 90367a027a22c3a9ca8b8bac15df34d9e859fc11 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/hisilicon/sec2/sec_main.c

index 6f0062d4408c35dcfd0a362f6ba63a9867379be0..e682e2a77b70cd5c1e6bbefe9461080f3930bd51 100644 (file)
@@ -921,7 +921,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);