Re: [PATCH] net: gemini: Fix memory leak in gmac_setup_txqs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +++ b/drivers/net/ethernet/cortina/gemini.c
> @@ -576,6 +576,8 @@ static int gmac_setup_txqs(struct net_device *netdev)
>
>  	if (port->txq_dma_base & ~DMA_Q_BASE_MASK) {
>  		dev_warn(geth->dev, "TX queue base is not aligned\n");
> +		dma_free_coherent(geth->dev, len * sizeof(*desc_ring),
> +				  desc_ring, port->txq_dma_base);
>  		kfree(skb_tab);
>  		return -ENOMEM;
>  	}

The added function call seems to be fine.
Would you like to avoid a bit of duplicate code for the exception handling?

Regards,
Markus




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux