diff options
author | Oliver Hartkopp <oliver@hartkopp.net> | 2009-08-10 22:41:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 19:33:01 -0400 |
commit | 993e6f2fd487e2acddd711f79cf48f3420731382 (patch) | |
tree | f68fe3d6ab0640d9f258434ddaa4e8cf060251b0 /drivers/net/can/dev.c | |
parent | 839d1624b9dcf31fdc02e47359043bb7bd71d6ca (diff) |
can: fix oops caused by wrong rtnl newlink usage
For 'real' hardware CAN devices the netlink interface is used to set CAN
specific communication parameters. Real CAN hardware can not be created with
the ip tool ...
The invocation of 'ip link add type can' lead to an oops as the standard rtnl
newlink function was called:
http://bugzilla.kernel.org/show_bug.cgi?id=13954
This patch adds a private newlink function for the CAN device driver interface
that unconditionally returns -EOPNOTSUPP.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
CC: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r-- | drivers/net/can/dev.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 9e4283aff828..e1a4f8214239 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -611,11 +611,18 @@ nla_put_failure: | |||
611 | return -EMSGSIZE; | 611 | return -EMSGSIZE; |
612 | } | 612 | } |
613 | 613 | ||
614 | static int can_newlink(struct net_device *dev, | ||
615 | struct nlattr *tb[], struct nlattr *data[]) | ||
616 | { | ||
617 | return -EOPNOTSUPP; | ||
618 | } | ||
619 | |||
614 | static struct rtnl_link_ops can_link_ops __read_mostly = { | 620 | static struct rtnl_link_ops can_link_ops __read_mostly = { |
615 | .kind = "can", | 621 | .kind = "can", |
616 | .maxtype = IFLA_CAN_MAX, | 622 | .maxtype = IFLA_CAN_MAX, |
617 | .policy = can_policy, | 623 | .policy = can_policy, |
618 | .setup = can_setup, | 624 | .setup = can_setup, |
625 | .newlink = can_newlink, | ||
619 | .changelink = can_changelink, | 626 | .changelink = can_changelink, |
620 | .fill_info = can_fill_info, | 627 | .fill_info = can_fill_info, |
621 | .fill_xstats = can_fill_xstats, | 628 | .fill_xstats = can_fill_xstats, |