|
@@ -5805,7 +5805,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
|
|
sizeof(*txq_pcpu->buffs),
|
|
|
GFP_KERNEL);
|
|
|
if (!txq_pcpu->buffs)
|
|
|
- goto cleanup;
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
txq_pcpu->count = 0;
|
|
|
txq_pcpu->reserved_num = 0;
|
|
@@ -5821,26 +5821,10 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
|
|
|
&txq_pcpu->tso_headers_dma,
|
|
|
GFP_KERNEL);
|
|
|
if (!txq_pcpu->tso_headers)
|
|
|
- goto cleanup;
|
|
|
+ return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
-cleanup:
|
|
|
- for_each_present_cpu(cpu) {
|
|
|
- txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
|
|
|
- kfree(txq_pcpu->buffs);
|
|
|
-
|
|
|
- dma_free_coherent(port->dev->dev.parent,
|
|
|
- txq_pcpu->size * TSO_HEADER_SIZE,
|
|
|
- txq_pcpu->tso_headers,
|
|
|
- txq_pcpu->tso_headers_dma);
|
|
|
- }
|
|
|
-
|
|
|
- dma_free_coherent(port->dev->dev.parent,
|
|
|
- txq->size * MVPP2_DESC_ALIGNED_SIZE,
|
|
|
- txq->descs, txq->descs_dma);
|
|
|
-
|
|
|
- return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
/* Free allocated TXQ resources */
|