[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1228923679.5035.3.camel@ataraxia>
Date: Wed, 10 Dec 2008 15:41:19 +0000
From: Daniel Silverstone <dsilvers@...tec.co.uk>
To: David Miller <davem@...emloft.net>
Cc: bhutchings@...arflare.com, netdev@...r.kernel.org
Subject: Re: [Patch] Micrel KS8695 integrated ethernet driver
On Tue, 2008-12-09 at 23:05 -0800, David Miller wrote:
> > + mapping = dma_map_single(ksp->dev, skb->data,
> > + MAX_RXBUF_SIZE,
> > + DMA_FROM_DEVICE);
> > + if (!mapping) {
> There is a proper way to check for DMA mapping failures.
> Comparing against zero is not it :-)
> > + ksp->tx_buffers[buff_n].dma_ptr = dma_map_single(
> > + ksp->dev, skb->data, skb->len, DMA_TO_DEVICE);
> > + if (!ksp->tx_buffers[buff_n].dma_ptr) {
> Likewise.
When I had a quick frobble around for other drivers using dma_map_single
I didn't see any error checking so I guessed. I guessed wrongly :-(
I've attached a driver which is the same as before but uses
dma_mapping_error() to check the result.
I trust that this is the last issue :-)
Regards,
Daniel.
--
Daniel Silverstone http://www.simtec.co.uk/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895
View attachment "ks8695-ethernet-net-next-2.6.patch" of type "text/x-patch" (51900 bytes)
Powered by blists - more mailing lists