diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-09-04 09:19:51 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-11 16:02:50 +0200 |
commit | 5c09cfa5d21cfd820c183bd188be6f215d99770e (patch) | |
tree | 9187d0a93e6180afbad228258e25b53feca5ede2 /drivers/misc | |
parent | e9e46ed220abe2bac542d1b682d6dff68145c19f (diff) | |
download | linux-stable-5c09cfa5d21cfd820c183bd188be6f215d99770e.tar.gz linux-stable-5c09cfa5d21cfd820c183bd188be6f215d99770e.tar.bz2 linux-stable-5c09cfa5d21cfd820c183bd188be6f215d99770e.zip |
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 <lihongbo22@huawei.com>
Link: https://lore.kernel.org/r/20240904011951.2010646-1-lihongbo22@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/cxl/sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c index 315c43f17dd3..409bd1c39663 100644 --- a/drivers/misc/cxl/sysfs.c +++ b/drivers/misc/cxl/sysfs.c @@ -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, |