]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
iwl4965: Fix a memory leak in error handling code of __il4965_up
authorJia-Ju Bai <baijiaju1990@163.com>
Fri, 18 Mar 2016 02:28:33 +0000 (13:28 +1100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Apr 2016 16:37:49 +0000 (19:37 +0300)
When il4965_hw_nic_init in __il4965_up fails, the memory allocated by
iwl4965_sta_alloc_lq in iwl4965_alloc_bcast_station is not freed.

This patches adds il_dealloc_bcast_stations in the error handling code of
__il4965_up to fix this problem.

This patch has been tested in real device, and it actually fixes the bug.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlegacy/4965-mac.c

index b75f4ef3cdc7b278ec837f83fd576444f5ce0008..30d9dd3dda53ed7599ed836064bdf2da550ce2ec 100644 (file)
@@ -5577,6 +5577,7 @@ __il4965_up(struct il_priv *il)
        ret = il4965_hw_nic_init(il);
        if (ret) {
                IL_ERR("Unable to init nic\n");
+               il_dealloc_bcast_stations(il);
                return ret;
        }