diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2025-01-25 11:12:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-21 09:20:30 +0100 |
commit | 14e694dbf285e74af97d50212e3272d0d22ea653 (patch) | |
tree | 9a88298c1337cd30f45f10d47f6bea271c7da467 | |
parent | 7de24e20a7aa83295e567982b0b29f3b53152759 (diff) |
firmware: dmi: Mark bin_attributes as __ro_after_init
The attributes are only modified during the __init phase.
Protect them against accidental or intentional modifications afterwards.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250125-sysfs-const-bin_attr-dmi-v2-1-ece1895936f4@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/firmware/dmi_scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index fde0656481cc..70d39adf50dc 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -761,8 +761,8 @@ static void __init dmi_scan_machine(void) pr_info("DMI not present or invalid.\n"); } -static BIN_ATTR_SIMPLE_ADMIN_RO(smbios_entry_point); -static BIN_ATTR_SIMPLE_ADMIN_RO(DMI); +static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(smbios_entry_point); +static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(DMI); static int __init dmi_init(void) { |