diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-11 10:33:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-11 16:10:09 +0100 |
commit | 7bbb89b420d9e290cb34864832de8fcdf2c140dc (patch) | |
tree | 43132319a1f5d764f30d67758bb1aa4103588831 /drivers/base/base.h | |
parent | kobject: Fix slab-out-of-bounds in fill_kobj_path() (diff) | |
download | linux-7bbb89b420d9e290cb34864832de8fcdf2c140dc.tar.xz linux-7bbb89b420d9e290cb34864832de8fcdf2c140dc.zip |
driver core: change to_subsys_private() to use container_of_const()
The macro to_subsys_private() needs to switch to using
container_of_const() as it turned out to being incorrectly casting a
const pointer to a non-const one. Make this change and fix up the one
offending user to be correctly handling a const pointer properly.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230111093327.3955063-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r-- | drivers/base/base.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 7d4803c03d3e..2eb722d89f10 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -53,7 +53,7 @@ struct subsys_private { struct kset glue_dirs; struct class *class; }; -#define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj) +#define to_subsys_private(obj) container_of_const(obj, struct subsys_private, subsys.kobj) struct driver_private { struct kobject kobj; |