“2315ffa0a9f789c588c7139effa7404a387d8685”上不存在“git@gitcode.net:openanolis/cloud-kernel.git”
提交 fe119a05 编写于 作者: M Marc Kleine-Budde 提交者: David S. Miller

can: dev: fix nlmsg size calculation in can_get_size()

This patch fixes the calculation of the nlmsg size, by adding the missing
nla_total_size().
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0a7e2260
...@@ -705,14 +705,14 @@ static size_t can_get_size(const struct net_device *dev) ...@@ -705,14 +705,14 @@ static size_t can_get_size(const struct net_device *dev)
size_t size; size_t size;
size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ 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 += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */
size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */
size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */
if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ 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 */ 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; return size;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册