Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338751
b: refs/heads/master
c: 5de55b2
h: refs/heads/master
i:
  338749: ff78b52
  338747: eff0bcb
  338743: af4bbb9
  338735: fdc9d72
  338719: df1b992
  338687: 4410a75
v: v3
  • Loading branch information
Matthieu CASTET authored and Linus Torvalds committed Dec 12, 2012
1 parent c499f40 commit 2d9f22d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ff4868e3051d9128a24dd330bed32011a11421d
refs/heads/master: 5de55b265a13bc263c823bbe05d87d2c5e785f6f
24 changes: 24 additions & 0 deletions trunk/mm/dmapool.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,30 @@ void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags,
retval = offset + page->vaddr;
*handle = offset + page->dma;
#ifdef DMAPOOL_DEBUG
{
int i;
u8 *data = retval;
/* page->offset is stored in first 4 bytes */
for (i = sizeof(page->offset); i < pool->size; i++) {
if (data[i] == POOL_POISON_FREED)
continue;
if (pool->dev)
dev_err(pool->dev,
"dma_pool_alloc %s, %p (corruped)\n",
pool->name, retval);
else
pr_err("dma_pool_alloc %s, %p (corruped)\n",
pool->name, retval);

/*
* Dump the first 4 bytes even if they are not
* POOL_POISON_FREED
*/
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_OFFSET, 16, 1,
data, pool->size, 1);
break;
}
}
memset(retval, POOL_POISON_ALLOCATED, pool->size);
#endif
spin_unlock_irqrestore(&pool->lock, flags);
Expand Down

0 comments on commit 2d9f22d

Please sign in to comment.