diff --git a/net/core/devlink.c b/net/core/devlink.c index 66d36705fb9dba2697688afbdf82d102fbbf5e87..18d385ed82370a7b6a9a2e31023b785a054e9e9f 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -3182,6 +3182,7 @@ int devlink_resource_register(struct devlink *devlink, resource_list = &parent_resource->resource_list; resource->parent = parent_resource; } else { + kfree(resource); err = -EINVAL; goto out; }