mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
nullio_exec_read(): Fix kunmap() argument
The argument of kunmap() is of type struct page *. Detected by smatch. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5571 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user