diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-10-05 21:25:17 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-11-28 14:01:56 +0000 |
commit | 69c1c491074f33cf282b374a0518e94cc85a49d6 (patch) | |
tree | 1e025eedb23e8ef0bb2d8acb58fc6442aa1bba59 /drivers | |
parent | 4ba76ac268b89169d3285929d7e249335ba0c728 (diff) |
can: dev: fix nlmsg size calculation in can_get_size()
[ Upstream commit fe119a05f8ca481623a8d02efcc984332e612528 ]
This patch fixes the calculation of the nlmsg size, by adding the missing
nla_total_size().
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/can/dev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index a3190574c3e6..de87f82732c7 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -658,14 +658,14 @@ static size_t can_get_size(const struct net_device *dev) size_t size; size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ - size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ + size += nla_total_size(sizeof(struct can_ctrlmode)); /* IFLA_CAN_CTRLMODE */ size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ - size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ - size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ + size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */ + size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */ if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ - size += sizeof(struct can_berr_counter); + size += nla_total_size(sizeof(struct can_berr_counter)); if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ - size += sizeof(struct can_bittiming_const); + size += nla_total_size(sizeof(struct can_bittiming_const)); return size; } |