crypto: hisilicon/qm - Add the err memory release process to qm uninit
authorChenghai Huang <huangchenghai2@huawei.com>
Sun, 7 Apr 2024 08:00:00 +0000 (16:00 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 12 Apr 2024 07:07:53 +0000 (15:07 +0800)
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>
drivers/crypto/hisilicon/qm.c

index cedb3af1fc1a065cfdc5c786f0865dec1f60f8da..3dac8d8e856866bb2361f73b4a23fa72476acfcd 100644 (file)
@@ -2896,12 +2896,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);