net/sfc: fix multicast address list copy memory leak
authorAndrew Rybchenko <arybchenko@solarflare.com>
Wed, 13 Dec 2017 07:12:17 +0000 (07:12 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
Fixes: 295f647a38a2 ("net/sfc: set multicast address list in started state only")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
drivers/net/sfc/sfc_port.c

index 55d8d46..d71ec18 100644 (file)
@@ -406,7 +406,10 @@ sfc_port_attach(struct sfc_adapter *sa)
 fail_kvarg_stats_update_period_ms:
 fail_mac_stats_dma_alloc:
        rte_free(port->mac_stats_buf);
+
 fail_mac_stats_buf_alloc:
+       rte_free(port->mcast_addrs);
+
 fail_mcast_addr_list_buf_alloc:
        sfc_log_init(sa, "failed %d", rc);
        return rc;
@@ -422,6 +425,8 @@ sfc_port_detach(struct sfc_adapter *sa)
        sfc_dma_free(sa, &port->mac_stats_dma_mem);
        rte_free(port->mac_stats_buf);
 
+       rte_free(port->mcast_addrs);
+
        sfc_log_init(sa, "done");
 }