linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] dma-debug: Fix coccinelle warnings in device_dma_allocations()
@ 2013-11-26 20:51 Shuah Khan
  0 siblings, 0 replies; only message in thread
From: Shuah Khan @ 2013-11-26 20:51 UTC (permalink / raw)
  To: akpm, alexander.h.duyck, dan.carpenter
  Cc: Shuah Khan, linux-kernel, shuahkhan

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-26 20:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 20:51 [PATCH linux-next] dma-debug: Fix coccinelle warnings in device_dma_allocations() Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).