Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm_scmi: don't mess with ->d_parent->d_name

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/20250112080705.141166-18-viro@zeniv.linux.org.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Al Viro and committed by
Greg Kroah-Hartman
f22fa721 f9c8dbc8

+6 -6
+6 -6
drivers/firmware/arm_scmi/raw_mode.c
··· 886 886 887 887 static int scmi_dbg_raw_mode_open(struct inode *inode, struct file *filp) 888 888 { 889 - u8 id; 890 889 struct scmi_raw_mode_info *raw; 891 890 struct scmi_dbg_raw_data *rd; 892 - const char *id_str = filp->f_path.dentry->d_parent->d_name.name; 893 891 894 892 if (!inode->i_private) 895 893 return -ENODEV; ··· 913 915 } 914 916 915 917 /* Grab channel ID from debugfs entry naming if any */ 916 - if (!kstrtou8(id_str, 16, &id)) 917 - rd->chan_id = id; 918 + /* not set - reassing 0 we already had after kzalloc() */ 919 + rd->chan_id = debugfs_get_aux_num(filp); 918 920 919 921 rd->raw = raw; 920 922 filp->private_data = rd; ··· 1223 1225 snprintf(cdir, 8, "0x%02X", channels[i]); 1224 1226 chd = debugfs_create_dir(cdir, top_chans); 1225 1227 1226 - debugfs_create_file("message", 0600, chd, raw, 1228 + debugfs_create_file_aux_num("message", 0600, chd, 1229 + raw, channels[i], 1227 1230 &scmi_dbg_raw_mode_message_fops); 1228 1231 1229 - debugfs_create_file("message_async", 0600, chd, raw, 1232 + debugfs_create_file_aux_num("message_async", 0600, chd, 1233 + raw, channels[i], 1230 1234 &scmi_dbg_raw_mode_message_async_fops); 1231 1235 } 1232 1236 }