From 3208a459a0ea1e1ce7de273d3bf174cf59ab4ee7 Mon Sep 17 00:00:00 2001 From: yumeng Date: Thu, 11 Jul 2019 14:41:32 +0800 Subject: [PATCH] ACC: SRIOV problem, add "#ifdef CONFIG_PCI_IOV" in hpre_remove(); driver inclusion category: bugfix bugzilla: NA CVE: NA SRIOV problem, add "#ifdef CONFIG_PCI_IOV" in hpre_remove(). Signed-off-by: yumeng Reviewed-by: xuzaibo Signed-off-by: lingmingqiang Signed-off-by: Yang Yingliang --- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 3 +-- drivers/crypto/hisilicon/hpre/hpre_main.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/hisilicon/hpre/hpre_crypto.c b/drivers/crypto/hisilicon/hpre/hpre_crypto.c index 1fb6b07bd466..ff72ee904982 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_crypto.c +++ b/drivers/crypto/hisilicon/hpre/hpre_crypto.c @@ -234,8 +234,7 @@ static int _cp_data_to_dma_buf(struct hpre_asym_request *hpre_req, } if (is_src) { scatterwalk_map_and_copy(ptr + shift, data, 0, len, 0); - if (is_dh) - (void)hpre_bn_format(ptr, ctx->key_sz); + (void)hpre_bn_format(ptr, ctx->key_sz); hpre_req->src_align = ptr; } else { hpre_req->dst_align = ptr; diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 95ab6ae62b53..9232f661dce6 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -1246,6 +1246,7 @@ static void hpre_remove(struct pci_dev *pdev) int ret; hpre_remove_from_list(hpre); +#ifdef CONFIG_PCI_IOV if (qm->fun_type == QM_HW_PF && hpre->ctrl->num_vfs != 0) { ret = hpre_sriov_disable(pdev); if (ret) { @@ -1253,6 +1254,7 @@ static void hpre_remove(struct pci_dev *pdev) return; } } +#endif hpre_debugfs_exit(hpre); hisi_qm_stop(qm); if (qm->fun_type == QM_HW_PF) -- GitLab