mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
platform/x86: intel: Move debugfs register before creating devices
It is possible that the driver handling device is enumerated before
registering debugfs. If the driver wants to access debugfs by calling
tpmi_get_debugfs_dir(), this will return error in this case.
Hence register debugfs before creating devices.
Fixes: 811f67c516 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Stable@vger.kernel.org
Link: https://patch.msgid.link/20260430151103.1549733-2-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
90dc96c61b
commit
ad3bff944c
|
|
@ -817,10 +817,6 @@ static int intel_vsec_tpmi_init(struct auxiliary_device *auxdev)
|
|||
|
||||
auxiliary_set_drvdata(auxdev, tpmi_info);
|
||||
|
||||
ret = tpmi_create_devices(tpmi_info);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Allow debugfs when security policy allows. Everything this debugfs
|
||||
* interface provides, can also be done via /dev/mem access. If
|
||||
|
|
@ -830,6 +826,12 @@ static int intel_vsec_tpmi_init(struct auxiliary_device *auxdev)
|
|||
if (!security_locked_down(LOCKDOWN_DEV_MEM) && capable(CAP_SYS_RAWIO))
|
||||
tpmi_dbgfs_register(tpmi_info);
|
||||
|
||||
ret = tpmi_create_devices(tpmi_info);
|
||||
if (ret) {
|
||||
debugfs_remove_recursive(tpmi_info->dbgfs_dir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user