Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83246
b: refs/heads/master
c: 1d96354
h: refs/heads/master
v: v3
  • Loading branch information
Or Gerlitz authored and Roland Dreier committed Feb 5, 2008
1 parent 7b3aa31 commit f792500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fe4bcf45ece0b0081031edaaa41581c85ef7049
refs/heads/master: 1d96354e617990799b1cb5d7ff8f7c467b8767c8
7 changes: 5 additions & 2 deletions trunk/drivers/infiniband/core/fmr_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,13 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
.max_maps = pool->max_remaps,
.page_shift = params->page_shift
};
int bytes_per_fmr = sizeof *fmr;

if (pool->cache_bucket)
bytes_per_fmr += params->max_pages_per_fmr * sizeof (u64);

for (i = 0; i < params->pool_size; ++i) {
fmr = kmalloc(sizeof *fmr + params->max_pages_per_fmr * sizeof (u64),
GFP_KERNEL);
fmr = kmalloc(bytes_per_fmr, GFP_KERNEL);
if (!fmr) {
printk(KERN_WARNING PFX "failed to allocate fmr "
"struct for FMR %d\n", i);
Expand Down

0 comments on commit f792500

Please sign in to comment.