]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/hns: Initialize seqfile before creating file
authorJunxian Huang <huangjunxian6@hisilicon.com>
Thu, 7 May 2026 01:21:46 +0000 (09:21 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 18 May 2026 08:58:41 +0000 (04:58 -0400)
commitb4070770506ff516e21b4923afdaf7eb5da0e150
tree3db4d5b428672ecab6127653a947a71729097564
parente456dc2d81a6b43c7ace4036cceea7a822d17a13
RDMA/hns: Initialize seqfile before creating file

The debugfs file was created before seq->read and seq->data were set,
leaving a small window where userspace could access an uninitialized
seqfile.

Move debugfs_create_file() after the assignments to avoid this issue.
Also, inline the original init_debugfs_seqfile() since it is not a
really necessary helper.

Fixes: ca7ad04cd5d2 ("RDMA/hns: Add debugfs to hns RoCE")
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
Link: https://patch.msgid.link/20260507012148.1079712-2-huangjunxian6@hisilicon.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/hns/hns_roce_debugfs.c