lkml.org 
[lkml]   [2017]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 19/60] hyper_dmabuf: fix the case with sharing a buffer with 2 pages
Date
From: Mateusz Polrola <mateuszx.potrola@intel.com>

Checking whether buffer has more than two pages should be done
by evaluating nents > 1 instead of i > 1 to properly cover the
case when nents == 2.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
---
drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c b/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
index b61d29a..9b05063 100644
--- a/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
+++ b/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
@@ -129,7 +129,7 @@ struct sg_table* hyper_dmabuf_create_sgt(struct page **pages,
sg_set_page(sgl, pages[i], PAGE_SIZE, 0);
}

- if (i > 1) /* more than one page */ {
+ if (nents > 1) /* more than one page */ {
sgl = sg_next(sgl);
sg_set_page(sgl, pages[i], last_len, 0);
}
--
2.7.4
\
 
 \ /
  Last update: 2017-12-19 20:49    [W:0.764 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site