The IRQ array allocated by ath11k_mhi_get_msi() is owned by ath11k, not by the MHI controller core. Registration failures free the controller without freeing this array. Free the array on the shared controller cleanup path, just as during normal unregister. The pointer is NULL before get_msi succeeds. This issue was found by our static analysis tool under development. Fixes: 1399fb87ea3e ("ath11k: register MHI controller device for QCA6390") Signed-off-by: Guangshuo Li --- drivers/net/wireless/ath/ath11k/mhi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c index a6c9ff112c68..134a75450bef 100644 --- a/drivers/net/wireless/ath/ath11k/mhi.c +++ b/drivers/net/wireless/ath/ath11k/mhi.c @@ -416,6 +416,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci) return 0; free_controller: + kfree(mhi_ctrl->irq); mhi_free_controller(mhi_ctrl); ab_pci->mhi_ctrl = NULL; return ret; base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907