net/enic: fix memory freeing
authorNelson Escobar <neescoba@cisco.com>
Thu, 23 Jun 2016 23:14:58 +0000 (16:14 -0700)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 28 Jun 2016 11:08:25 +0000 (13:08 +0200)
commitda5f560be966aea25510953efc31b76e27976f0e
treec4fd43d165736e43d90c4201f27c0c61247e9d3b
parent9d802d1cb902931cd8236177a1aaf3053143d75e
net/enic: fix memory freeing

enic_alloc_consistent() allocated memory, but enic_free_consistent()
was an empty function, so allocated memory was never freed.

This commit adds a list and lock to the enic structure to keep track
of the memzones allocated in enic_alloc_consistent(), and
enic_free_consistent() uses that information to properly free memory.

Fixes: fefed3d1e62c ("enic: new driver")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
drivers/net/enic/base/vnic_dev.c
drivers/net/enic/base/vnic_dev.h
drivers/net/enic/enic.h
drivers/net/enic/enic_main.c