summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-10-30 13:48:19 +0100
committerLuis Henriques <luis.henriques@canonical.com>2015-12-13 17:48:59 +0000
commita4d95541a1744ffea8294f11f14b83f3f47c7a92 (patch)
tree96a560fd39c8aa1db72cdebc7f3da8442c5de8ca
parent25a0fff87679e6cb186057933b5671612d49dd5d (diff)
downloadlinux-stable-a4d95541a1744ffea8294f11f14b83f3f47c7a92.tar.gz
linux-stable-a4d95541a1744ffea8294f11f14b83f3f47c7a92.tar.bz2
linux-stable-a4d95541a1744ffea8294f11f14b83f3f47c7a92.zip
can: Use correct type in sizeof() in nla_put()
commit 562b103a21974c2f9cd67514d110f918bb3e1796 upstream. 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 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
-rw-r--r--drivers/net/can/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index c543c3aaee4d..5635c6e7af57 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -835,7 +835,7 @@ static int can_fill_info(struct sk_buff *skb, const struct net_device *dev)
nla_put(skb, IFLA_CAN_BITTIMING_CONST,
sizeof(*priv->bittiming_const), priv->bittiming_const)) ||
- nla_put(skb, IFLA_CAN_CLOCK, sizeof(cm), &priv->clock) ||
+ nla_put(skb, IFLA_CAN_CLOCK, sizeof(priv->clock), &priv->clock) ||
nla_put_u32(skb, IFLA_CAN_STATE, state) ||
nla_put(skb, IFLA_CAN_CTRLMODE, sizeof(cm), &cm) ||
nla_put_u32(skb, IFLA_CAN_RESTART_MS, priv->restart_ms) ||