summaryrefslogtreecommitdiff
path: root/net/devlink/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/devlink/core.c')
-rw-r--r--net/devlink/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/devlink/core.c b/net/devlink/core.c
index da56e2b8afc1..44584f3613ca 100644
--- a/net/devlink/core.c
+++ b/net/devlink/core.c
@@ -111,7 +111,7 @@ static struct devlink_rel *devlink_rel_alloc(void)
static u32 next;
int err;
- rel = kzalloc(sizeof(*rel), GFP_KERNEL);
+ rel = kzalloc_obj(*rel, GFP_KERNEL);
if (!rel)
return ERR_PTR(-ENOMEM);
@@ -418,7 +418,7 @@ struct devlink *devlink_alloc_ns(const struct devlink_ops *ops,
if (!devlink_reload_actions_valid(ops))
return NULL;
- devlink = kvzalloc(struct_size(devlink, priv, priv_size), GFP_KERNEL);
+ devlink = kvzalloc_flex(*devlink, priv, priv_size, GFP_KERNEL);
if (!devlink)
return NULL;