Skip to content

Commit

Permalink
Don't use sysfs_emit in case we apply an offset to buf
Browse files Browse the repository at this point in the history
It's a function meant for safety, so it refuses to work with pointers
that don't start at a page boundary.
  • Loading branch information
srett committed Jan 16, 2024
1 parent bb0c9fb commit 531a83d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/kernel/xloop_main_6.6.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ static ssize_t xloop_attr_file_fmt_type_show(struct xloop_device *xlo, char *buf
ssize_t len = 0;

len = xloop_file_fmt_print_type(xlo->xlo_fmt->file_fmt_type, buf);
len += sysfs_emit(buf + len, "\n");
/* do not use sysfs_emit here, doesn't work with offset */
len += sprintf(buf + len, "\n");

return len;
}
Expand Down

0 comments on commit 531a83d

Please sign in to comment.