Skip to content

Commit 562b103

Browse files
Marek Vasutmarckleinebudde
authored andcommitted
can: Use correct type in sizeof() in nla_put()
The sizeof() is invoked on an incorrect variable, likely due to some copy-paste error, and this might result in memory corruption. Fix this. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: netdev@vger.kernel.org Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 89bc784 commit 562b103

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
915915
nla_put(skb, IFLA_CAN_BITTIMING_CONST,
916916
sizeof(*priv->bittiming_const), priv->bittiming_const)) ||
917917

918-
nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) ||
918+
nla_put(skb, IFLA_CAN_CLOCK, sizeof(priv->clock), &priv->clock) ||
919919
nla_put_u32(skb, IFLA_CAN_STATE, state) ||
920920
nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) ||
921921
nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) ||

0 commit comments

Comments
 (0)