scst_lib: WRITE SAME performance improvement fix

Fix the argument of the second kunmap() call. Detected by smatch.
See also patch "scst_lib: Improve WRITE SAME performance" (commit
ID a15628d683). Note: this patch does not have any impact on
64-bit architectures since kunmap() doesn't to anything on such
architectures.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
Bart Van Assche
2015-05-03 19:09:28 +02:00
parent 1c71987ad6
commit e392bcad89
+4 -2
View File
@@ -5866,16 +5866,18 @@ void scst_write_same(struct scst_cmd *cmd)
if (cmd->bufflen <= PAGE_SIZE / 2)
pg = alloc_page(GFP_KERNEL);
if (pg) {
struct page *src_pg;
void *src, *dst;
int k;
mult = 0;
src = kmap(sg_page(cmd->sg));
src_pg = sg_page(cmd->sg);
src = kmap(src_pg);
dst = kmap(pg);
for (k = 0; k < PAGE_SIZE; k += cmd->bufflen, mult++)
memcpy(dst + k, src + cmd->sg->offset, cmd->bufflen);
kunmap(pg);
kunmap(src);
kunmap(src_pg);
offset = 0;
length = k;
} else {