lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] check for allocation failure in ioat_dma_self_test
From
On Mon, Mar 4, 2013 at 6:11 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Mar 04, 2013 at 04:39:16PM +0800, Andrew Cooks wrote:
>> diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
>> index 1879a59..1f706c4 100644
>> --- a/drivers/dma/ioat/dma.c
>> +++ b/drivers/dma/ioat/dma.c
>> @@ -832,7 +832,18 @@ int ioat_dma_self_test(struct ioatdma_device *device)
>> }
>>
>> dma_src = dma_map_single(dev, src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
>> + err = dma_mapping_error(dev, dma_src);
>> + if (err) {
>> + dev_err(dev, "dma mapping failed: -%d\n", err);
>> + goto free_resources;
>> + }
>
> NAK. Please take the time to check what the functions you're using return
> rather than assuming what they return.

I see. The same mistake occurs in a few other drivers. I'll rework and
resend this and if all goes well I'll clean up the others.


\
 
 \ /
  Last update: 2013-03-06 03:41    [W:0.074 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site