Skip to content

Commit

Permalink
be2net: reset queue address after freeing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sathya Perla authored and David S. Miller committed Feb 24, 2012
1 parent 0ae57bb commit 1cfafab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1cfafab

Please sign in to comment.