Skip to content

Commit eb1ea13

Browse files
Hongbo Lisre
authored andcommitted
power: supply: ab8500: Constify struct kobj_type
This 'struct kobj_type' is not modified. It is only used in kobject_init_and_add() which takes a 'const struct kobj_type *ktype' parameter. Constifying this structure and moving it to a read-only section, and can increase over all security. Signed-off-by: Hongbo Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 48f703d commit eb1ea13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/power/supply/ab8500_fg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ static struct attribute *ab8500_fg_attrs[] = {
25312531
};
25322532
ATTRIBUTE_GROUPS(ab8500_fg);
25332533

2534-
static struct kobj_type ab8500_fg_ktype = {
2534+
static const struct kobj_type ab8500_fg_ktype = {
25352535
.sysfs_ops = &ab8500_fg_sysfs_ops,
25362536
.default_groups = ab8500_fg_groups,
25372537
};

0 commit comments

Comments
 (0)