can: netlink: can_changelink(): add missing error handling to call can_ctrlmode_changelink()

In commit e1a5cd9d66 ("can: netlink: add can_ctrlmode_changelink()") the
CAN Control Mode (IFLA_CAN_CTRLMODE) handling was factored out into the
can_ctrlmode_changelink() function. But the call to
can_ctrlmode_changelink() is missing the error handling.

Add the missing error handling and propagation to the call
can_ctrlmode_changelink().

Cc: stable@vger.kernel.org
Fixes: e1a5cd9d66 ("can: netlink: add can_ctrlmode_changelink()")
Link: https://patch.msgid.link/20260310-can_ctrlmode_changelink-add-error-handling-v1-1-0daf63d85922@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Marc Kleine-Budde 2026-03-10 13:48:03 +01:00
parent 8a63baadf0
commit cadf601923
1 changed files with 3 additions and 1 deletions

View File

@ -601,7 +601,9 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
/* We need synchronization with dev->stop() */
ASSERT_RTNL();
can_ctrlmode_changelink(dev, data, extack);
err = can_ctrlmode_changelink(dev, data, extack);
if (err)
return err;
if (data[IFLA_CAN_BITTIMING]) {
struct can_bittiming bt;