diff options
| author | Robert Richter <robert.richter@amd.com> | 2010-10-01 02:54:17 -0400 |
|---|---|---|
| committer | Robert Richter <robert.richter@amd.com> | 2010-10-01 02:54:17 -0400 |
| commit | ef70fcc0cd5d98f5e2df82c9e598b47f351d4f66 (patch) | |
| tree | b801ba4d7ebb1155df68d530df49444ffa6252cc /lib/scatterlist.c | |
| parent | 4cbe75be5c6ae86bdc7daec864eeb2dfd66f48bb (diff) | |
| parent | 98d943b02f6f1b57787ff1aa6f34d019a407e3ee (diff) | |
Merge branch 'oprofile/urgent' into oprofile/core
Conflicts:
arch/arm/oprofile/common.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'lib/scatterlist.c')
| -rw-r--r-- | lib/scatterlist.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index a5ec42868f99..4ceb05d772ae 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
| @@ -248,8 +248,18 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents, | |||
| 248 | left -= sg_size; | 248 | left -= sg_size; |
| 249 | 249 | ||
| 250 | sg = alloc_fn(alloc_size, gfp_mask); | 250 | sg = alloc_fn(alloc_size, gfp_mask); |
| 251 | if (unlikely(!sg)) | 251 | if (unlikely(!sg)) { |
| 252 | return -ENOMEM; | 252 | /* |
| 253 | * Adjust entry count to reflect that the last | ||
| 254 | * entry of the previous table won't be used for | ||
| 255 | * linkage. Without this, sg_kfree() may get | ||
| 256 | * confused. | ||
| 257 | */ | ||
| 258 | if (prv) | ||
| 259 | table->nents = ++table->orig_nents; | ||
| 260 | |||
| 261 | return -ENOMEM; | ||
| 262 | } | ||
| 253 | 263 | ||
| 254 | sg_init_table(sg, alloc_size); | 264 | sg_init_table(sg, alloc_size); |
| 255 | table->nents = table->orig_nents += sg_size; | 265 | table->nents = table->orig_nents += sg_size; |
