From 27fbb2351809be12aeaa65b506f1057726e75a00 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 6 Jun 2014 03:22:14 +0000 Subject: [PATCH] nullio_exec_read(): Fix kunmap() argument The argument of kunmap() is of type struct page *. Detected by smatch. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5571 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 8746bd580..481c2e6ea 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4751,16 +4751,18 @@ static enum compl_status_e nullio_exec_read(struct vdisk_cmd_params *p) if (virt_dev->read_zero) { struct scatterlist *sge; + struct page *page; int i; void *p; for_each_sg(cmd->sg, sge, cmd->sg_cnt, i) { - p = kmap(sg_page(sge)); + page = sg_page(sge); + p = kmap(page); if (sge->offset == 0 && sge->length == PAGE_SIZE) clear_page(p); else memset(p + sge->offset, 0, sge->length); - kunmap(p); + kunmap(page); } }