summaryrefslogtreecommitdiff
path: root/drivers/soundwire/intel_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/soundwire/intel_init.c')
-rw-r--r--drivers/soundwire/intel_init.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soundwire/intel_init.c b/drivers/soundwire/intel_init.c
index 4ffdabaf9693..982d25f92c7c 100644
--- a/drivers/soundwire/intel_init.c
+++ b/drivers/soundwire/intel_init.c
@@ -40,7 +40,7 @@ static struct sdw_intel_link_dev *intel_link_dev_register(struct sdw_intel_res *
struct auxiliary_device *auxdev;
int ret;
- ldev = kzalloc(sizeof(*ldev), GFP_KERNEL);
+ ldev = kzalloc_obj(*ldev, GFP_KERNEL);
if (!ldev)
return ERR_PTR(-ENOMEM);
@@ -186,7 +186,7 @@ static struct sdw_intel_ctx
* the parent .probe.
* If devm_ was used, the memory might never be freed on errors.
*/
- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+ ctx = kzalloc_obj(*ctx, GFP_KERNEL);
if (!ctx)
return NULL;
@@ -198,7 +198,7 @@ static struct sdw_intel_ctx
* If some links are disabled, the link pointer will remain NULL. Given that the
* number of links is small, this is simpler than using a list to keep track of links.
*/
- ctx->ldev = kcalloc(ctx->count, sizeof(*ctx->ldev), GFP_KERNEL);
+ ctx->ldev = kzalloc_objs(*ctx->ldev, ctx->count, GFP_KERNEL);
if (!ctx->ldev) {
kfree(ctx);
return NULL;
@@ -253,8 +253,8 @@ static struct sdw_intel_ctx
num_slaves++;
}
- ctx->peripherals = kmalloc(struct_size(ctx->peripherals, array, num_slaves),
- GFP_KERNEL);
+ ctx->peripherals = kmalloc_flex(*ctx->peripherals, array, num_slaves,
+ GFP_KERNEL);
if (!ctx->peripherals)
goto err;
ctx->peripherals->num_peripherals = num_slaves;