Skip to content

Commit d9e1886

Browse files
hartkoppgregkh
authored andcommitted
can: fix oops caused by wrong rtnl dellink usage
commit 25e1ed6e64f52a692ba3191c4fde650aab3ecc07 upstream. For 'real' hardware CAN devices the netlink interface is used to set CAN specific communication parameters. Real CAN hardware can not be created nor removed with the ip tool ... This patch adds a private dellink function for the CAN device driver interface that does just nothing. It's a follow up to commit 993e6f2 ("can: fix oops caused by wrong rtnl newlink usage") but for dellink. Reported-by: ajneu <ajneu1@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8648445 commit d9e1886

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/net/can/dev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,11 @@ static int can_newlink(struct net *src_net, struct net_device *dev,
10111011
return -EOPNOTSUPP;
10121012
}
10131013

1014+
static void can_dellink(struct net_device *dev, struct list_head *head)
1015+
{
1016+
return;
1017+
}
1018+
10141019
static struct rtnl_link_ops can_link_ops __read_mostly = {
10151020
.kind = "can",
10161021
.maxtype = IFLA_CAN_MAX,
@@ -1019,6 +1024,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
10191024
.validate = can_validate,
10201025
.newlink = can_newlink,
10211026
.changelink = can_changelink,
1027+
.dellink = can_dellink,
10221028
.get_size = can_get_size,
10231029
.fill_info = can_fill_info,
10241030
.get_xstats_size = can_get_xstats_size,

0 commit comments

Comments
 (0)