aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller2018-02-28 12:32:37 -0500
committerDavid S. Miller2018-02-28 12:32:37 -0500
commitb739012bdc272a58ffca54bf4e7b98139f1eebd8 (patch)
treeeea718420f95c54f6035102d89bc98019db0bf2f /net
parent7358799c3a40de99238759d82f5cf284dd880099 (diff)
parentb3529af6bb0d4fe72defdd539712ceffaa054fb3 (diff)
Merge branch 'mlxsw-fixes'
Jiri Pirko says: ==================== mlxsw: couple of fixes Couple of unrelated fixes for mlxsw. --- v1->v2: -patch 2: - rebase on top of current -net tree - removed forgotten empty line -patch 3: - new patch -patch 4: - new patch ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/devlink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 7b1076dc1292..2f2307d94787 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -2379,7 +2379,7 @@ devlink_resource_size_params_put(struct devlink_resource *resource,
{
struct devlink_resource_size_params *size_params;
- size_params = resource->size_params;
+ size_params = &resource->size_params;
if (nla_put_u64_64bit(skb, DEVLINK_ATTR_RESOURCE_SIZE_GRAN,
size_params->size_granularity, DEVLINK_ATTR_PAD) ||
nla_put_u64_64bit(skb, DEVLINK_ATTR_RESOURCE_SIZE_MAX,
@@ -3156,7 +3156,7 @@ int devlink_resource_register(struct devlink *devlink,
u64 resource_size,
u64 resource_id,
u64 parent_resource_id,
- struct devlink_resource_size_params *size_params,
+ const struct devlink_resource_size_params *size_params,
const struct devlink_resource_ops *resource_ops)
{
struct devlink_resource *resource;
@@ -3199,7 +3199,8 @@ int devlink_resource_register(struct devlink *devlink,
resource->id = resource_id;
resource->resource_ops = resource_ops;
resource->size_valid = true;
- resource->size_params = size_params;
+ memcpy(&resource->size_params, size_params,
+ sizeof(resource->size_params));
INIT_LIST_HEAD(&resource->resource_list);
list_add_tail(&resource->list, resource_list);
out: