]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: add missing attribute validation for termination
authorJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2020 05:05:16 +0000 (21:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Mar 2020 21:28:48 +0000 (13:28 -0800)
Add missing attribute validation for IFLA_CAN_TERMINATION
to the netlink policy.

Fixes: b152e5550d51 ("can: dev: add CAN interface termination API")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/can/dev.c

index 6ee06a49fb4cdc4d8ffcb029918590539d192ee0..68834a2853c9d86a290a2f7cf2de86578f4ad44a 100644 (file)
@@ -883,6 +883,7 @@ static const struct nla_policy can_policy[IFLA_CAN_MAX + 1] = {
                                = { .len = sizeof(struct can_bittiming) },
        [IFLA_CAN_DATA_BITTIMING_CONST]
                                = { .len = sizeof(struct can_bittiming_const) },
+       [IFLA_CAN_TERMINATION]  = { .type = NLA_U16 },
 };
 
 static int can_validate(struct nlattr *tb[], struct nlattr *data[],