Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F96463365
D41574.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41574.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h
--- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h
+++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h
@@ -343,7 +343,7 @@
{
unsigned int i, segs, cur, len;
int rc;
- struct scatterlist *s;
+ struct scatterlist *s, *sg_iter;
#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51300
if (prv != NULL) {
@@ -377,10 +377,18 @@
#endif
cur = 0;
- for (i = 0, s = sgt->sgl; i < sgt->orig_nents; i++) {
+ for_each_sg(sgt->sgl, sg_iter, sgt->orig_nents, i) {
unsigned long seg_size;
unsigned int j;
+ /*
+ * We need to make sure that when we exit this loop "s" has the
+ * last sg in the chain so we can call sg_mark_end() on it.
+ * Only set this inside the loop since sg_iter will be iterated
+ * until it is NULL.
+ */
+ s = sg_iter;
+
len = 0;
for (j = cur + 1; j < count; ++j) {
len += PAGE_SIZE;
@@ -394,8 +402,6 @@
size -= seg_size;
off = 0;
cur = j;
-
- s = sg_next(s);
}
KASSERT(s != NULL, ("s is NULL after loop in __sg_alloc_table_from_pages()"));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 26, 1:29 AM (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12804837
Default Alt Text
D41574.diff (1 KB)
Attached To
Mode
D41574: linuxkpi: Fix iteration in __sg_alloc_table_from_pages again
Attached
Detach File
Event Timeline
Log In to Comment