Skip to content

Commit 5c09cfa

Browse files
Hongbo Ligregkh
authored andcommitted
cxl: 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: Greg Kroah-Hartman <[email protected]>
1 parent e9e46ed commit 5c09cfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/misc/cxl/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void release_afu_config_record(struct kobject *kobj)
579579
kfree(cr);
580580
}
581581

582-
static struct kobj_type afu_config_record_type = {
582+
static const struct kobj_type afu_config_record_type = {
583583
.sysfs_ops = &kobj_sysfs_ops,
584584
.release = release_afu_config_record,
585585
.default_groups = afu_cr_groups,

0 commit comments

Comments
 (0)