Messages in this thread Patch in this message | | | From | Shuah Khan <> | Subject | [PATCH linux-next] dma-debug: Fix coccinelle warnings in device_dma_allocations() | Date | Tue, 26 Nov 2013 13:51:15 -0700 |
| |
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
| |