diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-08-04 09:14:38 -0400 |
commit | d790d4d583aeaed9fc6f8a9f4d9f8ce6b1c15c7f (patch) | |
tree | 854ab394486288d40fa8179cbfaf66e8bdc44b0f /drivers/crypto | |
parent | 73b2c7165b76b20eb1290e7efebc33cfd21db1ca (diff) | |
parent | 3a09b1be53d23df780a0cd0e4087a05e2ca4a00c (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/talitos.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 637c105f53d2..bd78acf3c365 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -1183,10 +1183,14 @@ static size_t sg_copy_end_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
1183 | /* Copy part of this segment */ | 1183 | /* Copy part of this segment */ |
1184 | ignore = skip - offset; | 1184 | ignore = skip - offset; |
1185 | len = miter.length - ignore; | 1185 | len = miter.length - ignore; |
1186 | if (boffset + len > buflen) | ||
1187 | len = buflen - boffset; | ||
1186 | memcpy(buf + boffset, miter.addr + ignore, len); | 1188 | memcpy(buf + boffset, miter.addr + ignore, len); |
1187 | } else { | 1189 | } else { |
1188 | /* Copy all of this segment */ | 1190 | /* Copy all of this segment (up to buflen) */ |
1189 | len = miter.length; | 1191 | len = miter.length; |
1192 | if (boffset + len > buflen) | ||
1193 | len = buflen - boffset; | ||
1190 | memcpy(buf + boffset, miter.addr, len); | 1194 | memcpy(buf + boffset, miter.addr, len); |
1191 | } | 1195 | } |
1192 | boffset += len; | 1196 | boffset += len; |