Commit 5c09cfa5 authored by Hongbo Li's avatar Hongbo Li Committed by Greg Kroah-Hartman
Browse files

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: default avatarHongbo Li <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20240904011951.2010646-1-lihongbo22@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e9e46ed2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ static void release_afu_config_record(struct kobject *kobj)
	kfree(cr);
}

static struct kobj_type afu_config_record_type = {
static const struct kobj_type afu_config_record_type = {
	.sysfs_ops = &kobj_sysfs_ops,
	.release = release_afu_config_record,
	.default_groups = afu_cr_groups,