]> www.infradead.org Git - users/jedix/linux-maple.git/commit
misc: c2port: Calculate bin_attribute size through group callback
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 21 Dec 2024 14:48:10 +0000 (15:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 08:36:02 +0000 (09:36 +0100)
commit85aa1342d7a554256611c8e8133bfa5208ffb823
tree03534fd3e7a6e0e479c97ba85a064b862fd68c15
parentc3b8c358c4f36faf610b76d546eb36178bb11b83
misc: c2port: Calculate bin_attribute size through group callback

Modifying the size of the global bin_attribute instance can be racy.
Instead use the new .bin_size callback to do so safely.

For this to work move the initialization of c2dev->ops before the call
to device_create() as the size callback will need access to it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241221-sysfs-const-bin_attr-misc-drivers-v2-4-ba5e79fe8771@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/c2port/core.c