Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210527
b: refs/heads/master
c: edce682
h: refs/heads/master
i:
  210525: ed49c35
  210523: 1bede72
  210519: c4e4077
  210511: a5afb6c
  210495: 8f5fc53
v: v3
  • Loading branch information
Jeffrey Carlyle authored and Jens Axboe committed Aug 30, 2010
1 parent ebf80e8 commit 00655ce
Show file tree
Hide file tree
Showing 2 changed files with 13 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: b76b4014f9d988d2412b873e4d4c13c7f9afc4e4
refs/heads/master: edce6820a9fdda85521211cb334a183e34cc455e
14 changes: 12 additions & 2 deletions trunk/lib/scatterlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,18 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
left -= sg_size;

sg = alloc_fn(alloc_size, gfp_mask);
if (unlikely(!sg))
return -ENOMEM;
if (unlikely(!sg)) {
/*
* Adjust entry count to reflect that the last
* entry of the previous table won't be used for
* linkage. Without this, sg_kfree() may get
* confused.
*/
if (prv)
table->nents = ++table->orig_nents;

return -ENOMEM;
}

sg_init_table(sg, alloc_size);
table->nents = table->orig_nents += sg_size;
Expand Down

0 comments on commit 00655ce

Please sign in to comment.