[PATCH 2/2] can: netlink: clear tdc if fd is turned off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When the FD is turned off through the netlink interface, the value
still remain in struct can_tdc and are displayed despite of the
feature being disabled.

This patch clears priv->tdc whenever FD is set to off. This way, the
TDC variables are not displayed anymore.

Signed-off-by: Vincent Mailhol <mailhol.vincent@xxxxxxxxxx>
---
Hi Marc,

I would suggest to squash that into commit 5eb2cd8e2ded ("can:
netlink: add interface for CAN-FD Transmitter Delay Compensation
(TDC)").
---
 drivers/net/can/dev/netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/dev/netlink.c b/drivers/net/can/dev/netlink.c
index b8d531e49540..b33e6da6ca5a 100644
--- a/drivers/net/can/dev/netlink.c
+++ b/drivers/net/can/dev/netlink.c
@@ -207,6 +207,7 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
 			dev->mtu = CAN_MTU;
 			memset(&priv->data_bittiming, 0,
 			       sizeof(priv->data_bittiming));
+			memset(&priv->tdc, 0, sizeof(priv->tdc));
 		}
 	}
 
-- 
2.31.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux