Skip to content

Commit 8ab3bf4

Browse files
t-8chKalle Valo
authored andcommitted
wifi: wlcore: sysfs: 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]> Signed-off-by: Kalle Valo <[email protected]> Link: https://patch.msgid.link/20241216-sysfs-const-bin_attr-net-v1-3-ec460b91f274@weissschuh.net
1 parent aeda924 commit 8ab3bf4

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/ti/wlcore

1 file changed

+2
-2
lines changed

drivers/net/wireless/ti/wlcore/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static ssize_t hw_pg_ver_show(struct device *dev,
8888
static DEVICE_ATTR_RO(hw_pg_ver);
8989

9090
static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj,
91-
struct bin_attribute *bin_attr,
91+
const struct bin_attribute *bin_attr,
9292
char *buffer, loff_t pos, size_t count)
9393
{
9494
struct device *dev = kobj_to_dev(kobj);
@@ -121,7 +121,7 @@ static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj,
121121

122122
static const struct bin_attribute fwlog_attr = {
123123
.attr = { .name = "fwlog", .mode = 0400 },
124-
.read = wl1271_sysfs_read_fwlog,
124+
.read_new = wl1271_sysfs_read_fwlog,
125125
};
126126

127127
int wlcore_sysfs_init(struct wl1271 *wl)

0 commit comments

Comments
 (0)