mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
driver core: make kobj_type constant.
This way instances of kobj_type (which contain function pointers) can be stored in .rodata, which means that they cannot be [easily/accidentally] modified at runtime. Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com> Link: https://lore.kernel.org/r/20211224231345.777370-1-wedsonaf@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
67e532a42c
commit
ee6d3dd4ed
6 changed files with 13 additions and 13 deletions
|
@ -928,7 +928,7 @@ static const struct sysfs_ops module_sysfs_ops = {
|
|||
|
||||
static int uevent_filter(struct kset *kset, struct kobject *kobj)
|
||||
{
|
||||
struct kobj_type *ktype = get_ktype(kobj);
|
||||
const struct kobj_type *ktype = get_ktype(kobj);
|
||||
|
||||
if (ktype == &module_ktype)
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue