Skip to content

Commit d16d7e9

Browse files
t-8chrafaeljw
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/20241202-sysfs-const-bin_attr-acpi-v1-2-78f3b38d350d@weissschuh.net Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent e687b81 commit d16d7e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/bgrt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ static struct attribute *bgrt_attributes[] = {
4040
NULL,
4141
};
4242

43-
static struct bin_attribute *bgrt_bin_attributes[] = {
43+
static const struct bin_attribute *const bgrt_bin_attributes[] = {
4444
&bin_attr_image,
4545
NULL,
4646
};
4747

4848
static const struct attribute_group bgrt_attribute_group = {
4949
.attrs = bgrt_attributes,
50-
.bin_attrs = bgrt_bin_attributes,
50+
.bin_attrs_new = bgrt_bin_attributes,
5151
};
5252

5353
int __init acpi_parse_bgrt(struct acpi_table_header *table)

0 commit comments

Comments
 (0)