ath11k: set register access length for MHI driver
authorBhaumik Bhatt <bbhatt@codeaurora.org>
Mon, 2 Aug 2021 05:12:51 +0000 (10:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Aug 2021 12:28:47 +0000 (14:28 +0200)
MHI driver requires register space length to add range checks and
prevent memory region accesses outside of that for MMIO space.
Set it before registering the MHI controller.

Link: https://lore.kernel.org/r/1620330705-40192-5-git-send-email-bbhatt@codeaurora.org
Reviewed-by: Hemant Kumar <hemantk@codeaurora.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20210802051255.5771-7-manivannan.sadhasivam@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath11k/mhi.c

index 75cc2d8..26c7ae2 100644 (file)
@@ -330,6 +330,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
        mhi_ctrl->cntrl_dev = ab->dev;
        mhi_ctrl->fw_image = ab_pci->amss_path;
        mhi_ctrl->regs = ab->mem;
+       mhi_ctrl->reg_len = ab->mem_len;
 
        ret = ath11k_mhi_get_msi(ab_pci);
        if (ret) {