Skip to content

Commit b129005

Browse files
dthompsoij-intel
authored andcommitted
mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show()
A warning is seen when running the latest kernel on a BlueField SOC: [251.512704] ------------[ cut here ]------------ [251.512711] invalid sysfs_emit: buf:0000000003aa32ae [251.512720] WARNING: CPU: 1 PID: 705264 at fs/sysfs/file.c:767 sysfs_emit+0xac/0xc8 The warning is triggered because the mlxbf-bootctl driver invokes "sysfs_emit()" with a buffer pointer that is not aligned to the start of the page. The driver should instead use "sysfs_emit_at()" to support non-zero offsets into the destination buffer. Fixes: 9886f57 ("platform/mellanox: mlxbf-bootctl: use sysfs_emit() instead of sprintf()") Signed-off-by: David Thompson <davthompson@nvidia.com> Link: https://lore.kernel.org/r/20250407132558.2418719-1-davthompson@nvidia.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 59df54c commit b129005

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/platform/mellanox/mlxbf-bootctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev,
333333
else
334334
status = valid ? "Invalid" : "Free";
335335
}
336-
buf_len += sysfs_emit(buf + buf_len, "%d:%s ", key, status);
336+
buf_len += sysfs_emit_at(buf, buf_len, "%d:%s ", key, status);
337337
}
338-
buf_len += sysfs_emit(buf + buf_len, "\n");
338+
buf_len += sysfs_emit_at(buf, buf_len, "\n");
339339

340340
return buf_len;
341341
}

0 commit comments

Comments
 (0)