[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241122-sysfs-const-bin_attr-dmi-v1-1-febd12fb27d9@weissschuh.net>
Date: Fri, 22 Nov 2024 11:34:29 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Jean Delvare <jdelvare@...e.com>
Cc: linux-kernel@...r.kernel.org,
Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH] 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@...ssschuh.net>
---
drivers/firmware/dmi_scan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index fde0656481cc9577b05b781b703a8071e8d3fc4e..70d39adf50dcaaa7c99b48fe8e9045af5ea24d00 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)
{
---
base-commit: 28eb75e178d389d325f1666e422bc13bbbb9804c
change-id: 20241122-sysfs-const-bin_attr-dmi-40c387a93dda
Best regards,
--
Thomas Weißschuh <linux@...ssschuh.net>
Powered by blists - more mailing lists