diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2012-02-23 18:50:15 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-24 01:50:16 -0500 |
commit | 1cfafab965198bc0d9cb794af5065d0797969727 (patch) | |
tree | 6be5c6d4ce33b8dabf74d4ff892e19a5f985f476 /drivers | |
parent | 0ae57bb3df562e57ac89ad7bc524b6f2e83235f9 (diff) | |
download | blackbird-op-linux-1cfafab965198bc0d9cb794af5065d0797969727.tar.gz blackbird-op-linux-1cfafab965198bc0d9cb794af5065d0797969727.zip |
be2net: reset queue address after freeing
This will prevent double free in some cases where be_clear() is called
for cleanup when be_setup() fails half-way.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 36ad9a7ef4ba..e3822788f532 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -127,9 +127,11 @@ static inline bool be_is_mc(struct be_adapter *adapter) { static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) { struct be_dma_mem *mem = &q->dma_mem; - if (mem->va) + if (mem->va) { dma_free_coherent(&adapter->pdev->dev, mem->size, mem->va, mem->dma); + mem->va = NULL; + } } static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q, @@ -1660,7 +1662,7 @@ static int be_evt_queues_create(struct be_adapter *adapter) if (rc) return rc; } - return rc; + return 0; } static void be_mcc_queues_destroy(struct be_adapter *adapter) |