lkml.org 
[lkml]   [2013]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH linux-next] dma-debug: Fix coccinelle warnings in device_dma_allocations()
Date
lib/dma-debug.c:740:11-16: ERROR: invalid reference to the index variable of the iterator on line 726

This error is a result of referencing entry->dev in dev_warn() when entry
might not be valid at the time of reference. Change dev_warn() to use input
parameter struct device *dev instead to print warning.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
lib/dma-debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index e34865e..5f29445 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -737,7 +737,7 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o
local_irq_restore(flags);

if (map_err_cnt)
- dev_warn(entry->dev,
+ dev_warn(dev,
"DMA-API: device driver failed to check map errors: "
"[count] = %d\n", map_err_cnt);
return count;
--
1.8.3.2


\
 
 \ /
  Last update: 2013-11-26 22:41    [W:0.029 / U:28.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site