Skip to content

Commit

Permalink
dma-debug: check nents in dma_sync_sg*
Browse files Browse the repository at this point in the history
Like dma_unmap_sg, dma_sync_sg* should be called with the original number
of entries passed to dma_map_sg, so do the same check in the sync path as
we do in the unmap path.

Signed-off-by: Robin Murphy <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Sumit Semwal <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rmurphy-arm authored and torvalds committed Nov 7, 2015
1 parent 002edb6 commit 7f83064
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,14 @@ static void check_sync(struct device *dev,
dir2name[entry->direction],
dir2name[ref->direction]);

if (ref->sg_call_ents && ref->type == dma_debug_sg &&
ref->sg_call_ents != entry->sg_call_ents) {
err_printk(ref->dev, entry, "DMA-API: device driver syncs "
"DMA sg list with different entry count "
"[map count=%d] [sync count=%d]\n",
entry->sg_call_ents, ref->sg_call_ents);
}

out:
put_hash_bucket(bucket, &flags);
}
Expand Down

0 comments on commit 7f83064

Please sign in to comment.