Skip to content

Commit cadf601

Browse files
can: netlink: can_changelink(): add missing error handling to call can_ctrlmode_changelink()
In commit e1a5cd9 ("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: [email protected] Fixes: e1a5cd9 ("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 <[email protected]>
1 parent 8a63baa commit cadf601

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/net/can/dev/netlink.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ static int can_changelink(struct net_device *dev, struct nlattr *tb[],
601601
/* We need synchronization with dev->stop() */
602602
ASSERT_RTNL();
603603

604-
can_ctrlmode_changelink(dev, data, extack);
604+
err = can_ctrlmode_changelink(dev, data, extack);
605+
if (err)
606+
return err;
605607

606608
if (data[IFLA_CAN_BITTIMING]) {
607609
struct can_bittiming bt;

0 commit comments

Comments
 (0)