Re: [PATCH v8 08/13] wifi: ath12k: add AHB driver support for IPQ5332

From: Raj Kumar Bhagat
Date: Wed Mar 05 2025 - 13:44:36 EST


On 3/1/2025 12:12 AM, Raj Kumar Bhagat wrote:
> +static int ath12k_ahb_probe(struct platform_device *pdev)
> +{
> + struct ath12k_base *ab;
> + const struct ath12k_hif_ops *hif_ops;
> + enum ath12k_hw_rev hw_rev;
> + u32 addr;
> + int ret;
> +
> + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to set 32-bit coherent dma\n");
> + return ret;
> + }
> +
> + ab = ath12k_core_alloc(&pdev->dev, sizeof(struct ath12k_ahb),
> + ATH12K_BUS_AHB);
> + if (!ab)
> + return -ENOMEM;
> +
> + hw_rev = (enum ath12k_hw_rev)of_device_get_match_data(&pdev->dev);
> + switch (hw_rev) {
> + case ATH12K_HW_IPQ5332_HW10:
> + hif_ops = &ath12k_ahb_hif_ops_ipq5332;
> + break;
> + default:
> + return -EOPNOTSUPP;
> + }

The ab should be freed before returning.
Will fix this memory leak in next version (v9).