diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 22:02:58 +0300 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 22:02:58 +0300 |
| commit | 8934827db5403eae57d4537114a9ff88b0a8460f (patch) | |
| tree | 5167aa7e16b786b9135e19d508b234054fa6e8ce /drivers/devfreq | |
| parent | c7decec2f2d2ab0366567f9e30c0e1418cece43f (diff) | |
| parent | 7a70c15bd1449f1eb30991772edce37b41e496fb (diff) | |
| download | linux-8934827db5403eae57d4537114a9ff88b0a8460f.tar.xz | |
Merge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull kmalloc_obj conversion from Kees Cook:
"This does the tree-wide conversion to kmalloc_obj() and friends using
coccinelle, with a subsequent small manual cleanup of whitespace
alignment that coccinelle does not handle.
This uncovered a clang bug in __builtin_counted_by_ref(), so the
conversion is preceded by disabling that for current versions of
clang. The imminent clang 22.1 release has the fix.
I've done allmodconfig build tests for x86_64, arm64, i386, and arm. I
did defconfig builds for alpha, m68k, mips, parisc, powerpc, riscv,
s390, sparc, sh, arc, csky, xtensa, hexagon, and openrisc"
* tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
kmalloc_obj: Clean up after treewide replacements
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
compiler_types: Disable __builtin_counted_by_ref for Clang
Diffstat (limited to 'drivers/devfreq')
| -rw-r--r-- | drivers/devfreq/devfreq-event.c | 2 | ||||
| -rw-r--r-- | drivers/devfreq/devfreq.c | 2 | ||||
| -rw-r--r-- | drivers/devfreq/governor_passive.c | 3 | ||||
| -rw-r--r-- | drivers/devfreq/governor_userspace.c | 4 |
4 files changed, 5 insertions, 6 deletions
diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c index 70219099c604..36bb954e27ca 100644 --- a/drivers/devfreq/devfreq-event.c +++ b/drivers/devfreq/devfreq-event.c @@ -313,7 +313,7 @@ struct devfreq_event_dev *devfreq_event_add_edev(struct device *dev, if (!desc->ops->set_event || !desc->ops->get_event) return ERR_PTR(-EINVAL); - edev = kzalloc(sizeof(struct devfreq_event_dev), GFP_KERNEL); + edev = kzalloc_obj(struct devfreq_event_dev, GFP_KERNEL); if (!edev) return ERR_PTR(-ENOMEM); diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 00979f2e0e27..5c094c884aba 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -821,7 +821,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_out; } - devfreq = kzalloc(sizeof(struct devfreq), GFP_KERNEL); + devfreq = kzalloc_obj(struct devfreq, GFP_KERNEL); if (!devfreq) { err = -ENOMEM; goto err_out; diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 8cd6f9a59f64..c0271cc76bd9 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c @@ -310,8 +310,7 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq) continue; } - parent_cpu_data = kzalloc(sizeof(*parent_cpu_data), - GFP_KERNEL); + parent_cpu_data = kzalloc_obj(*parent_cpu_data, GFP_KERNEL); if (!parent_cpu_data) { ret = -ENOMEM; goto err_put_policy; diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c index 395174f93960..70509a1ceecd 100644 --- a/drivers/devfreq/governor_userspace.c +++ b/drivers/devfreq/governor_userspace.c @@ -87,8 +87,8 @@ static const struct attribute_group dev_attr_group = { static int userspace_init(struct devfreq *devfreq) { int err = 0; - struct userspace_data *data = kzalloc(sizeof(struct userspace_data), - GFP_KERNEL); + struct userspace_data *data = kzalloc_obj(struct userspace_data, + GFP_KERNEL); if (!data) { err = -ENOMEM; |
