This series of two patch prevents, once for all, can_priv to be in an inconsistent state in case of an early return in can_changelink() due to invalid parameters. * Changelog * v2 -> v3: - Allocate the temporary struct can_priv on the heap instead of declaring it as static. - Split the patch into two to make it easier to backport to LTS kernels and add the "Fixes" tag. v1 -> v2: - Change the prototype of can_calc_tdco() so that the changes are applied to the temporary priv instead of netdev_priv(dev). Vincent Mailhol (2): can: netlink: prevent incoherent can configuration in case of early return can: bittiming: change can_calc_tdco()'s prototype to not directly modify priv drivers/net/can/dev/bittiming.c | 8 ++------ drivers/net/can/dev/netlink.c | 34 ++++++++++++++++++--------------- include/linux/can/bittiming.h | 7 +++++-- 3 files changed, 26 insertions(+), 23 deletions(-) -- 2.32.0