diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 11:02:58 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 11:02:58 -0800 |
| commit | 8934827db5403eae57d4537114a9ff88b0a8460f (patch) | |
| tree | 5167aa7e16b786b9135e19d508b234054fa6e8ce /drivers/tee/amdtee | |
| parent | c7decec2f2d2ab0366567f9e30c0e1418cece43f (diff) | |
| parent | 7a70c15bd1449f1eb30991772edce37b41e496fb (diff) | |
Merge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linuxHEADmaster
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/tee/amdtee')
| -rw-r--r-- | drivers/tee/amdtee/call.c | 4 | ||||
| -rw-r--r-- | drivers/tee/amdtee/core.c | 10 | ||||
| -rw-r--r-- | drivers/tee/amdtee/shm_pool.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/tee/amdtee/call.c b/drivers/tee/amdtee/call.c index 460b0c9e511f..3d25cee5c7d0 100644 --- a/drivers/tee/amdtee/call.c +++ b/drivers/tee/amdtee/call.c @@ -134,7 +134,7 @@ static u32 get_ta_refcount(u32 ta_handle) if (ta_data->ta_handle == ta_handle) return ++ta_data->refcount; - ta_data = kzalloc(sizeof(*ta_data), GFP_KERNEL); + ta_data = kzalloc_obj(*ta_data, GFP_KERNEL); if (ta_data) { ta_data->ta_handle = ta_handle; ta_data->refcount = 1; @@ -293,7 +293,7 @@ int handle_map_shmem(u32 count, struct shmem_desc *start, u32 *buf_id) if (!count || !start || !buf_id) return -EINVAL; - cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); + cmd = kzalloc_obj(*cmd, GFP_KERNEL); if (!cmd) return -ENOMEM; diff --git a/drivers/tee/amdtee/core.c b/drivers/tee/amdtee/core.c index fb39d9a19c69..1ff4834722f7 100644 --- a/drivers/tee/amdtee/core.c +++ b/drivers/tee/amdtee/core.c @@ -38,7 +38,7 @@ static int amdtee_open(struct tee_context *ctx) { struct amdtee_context_data *ctxdata; - ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL); + ctxdata = kzalloc_obj(*ctxdata, GFP_KERNEL); if (!ctxdata) return -ENOMEM; @@ -122,7 +122,7 @@ static struct amdtee_session *alloc_session(struct amdtee_context_data *ctxdata, } /* Allocate a new session and add to list */ - sess = kzalloc(sizeof(*sess), GFP_KERNEL); + sess = kzalloc_obj(*sess, GFP_KERNEL); if (sess) { sess->ta_handle = ta_handle; kref_init(&sess->refcount); @@ -351,7 +351,7 @@ int amdtee_map_shmem(struct tee_shm *shm) if (!shm) return -EINVAL; - shmnode = kmalloc(sizeof(*shmnode), GFP_KERNEL); + shmnode = kmalloc_obj(*shmnode, GFP_KERNEL); if (!shmnode) return -ENOMEM; @@ -465,11 +465,11 @@ static int __init amdtee_driver_init(void) return rc; } - drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL); + drv_data = kzalloc_obj(*drv_data, GFP_KERNEL); if (!drv_data) return -ENOMEM; - amdtee = kzalloc(sizeof(*amdtee), GFP_KERNEL); + amdtee = kzalloc_obj(*amdtee, GFP_KERNEL); if (!amdtee) { rc = -ENOMEM; goto err_kfree_drv_data; diff --git a/drivers/tee/amdtee/shm_pool.c b/drivers/tee/amdtee/shm_pool.c index 6346e0bc8a64..fcb0d5da4bfd 100644 --- a/drivers/tee/amdtee/shm_pool.c +++ b/drivers/tee/amdtee/shm_pool.c @@ -59,7 +59,7 @@ static const struct tee_shm_pool_ops pool_ops = { struct tee_shm_pool *amdtee_config_shm(void) { - struct tee_shm_pool *pool = kzalloc(sizeof(*pool), GFP_KERNEL); + struct tee_shm_pool *pool = kzalloc_obj(*pool, GFP_KERNEL); if (!pool) return ERR_PTR(-ENOMEM); |
