summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-12-02 20:04:10 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-12-10 19:34:41 +0100
commitd16d7e91ed31f08903c698db42bbabe3dd454e07 (patch)
treec7849d87e961a0714c1dde6d72d027ac271ee15a
parente687b81f4c0e1e1d2cb84716523d7791fa34c8ff (diff)
ACPI: BGRT: Constify 'struct bin_attribute'
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://patch.msgid.link/20241202-sysfs-const-bin_attr-acpi-v1-2-78f3b38d350d@weissschuh.net Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/bgrt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
index 88837c291a76..35ece8e9f15d 100644
--- a/drivers/acpi/bgrt.c
+++ b/drivers/acpi/bgrt.c
@@ -40,14 +40,14 @@ static struct attribute *bgrt_attributes[] = {
NULL,
};
-static struct bin_attribute *bgrt_bin_attributes[] = {
+static const struct bin_attribute *const bgrt_bin_attributes[] = {
&bin_attr_image,
NULL,
};
static const struct attribute_group bgrt_attribute_group = {
.attrs = bgrt_attributes,
- .bin_attrs = bgrt_bin_attributes,
+ .bin_attrs_new = bgrt_bin_attributes,
};
int __init acpi_parse_bgrt(struct acpi_table_header *table)