Skip to contentSkip to conversation

can: fix oops caused by wrong rtnl dellink usage

PATCH Applied Oliver Hartkopp 2 participants 3 messages Jun 21, 2016 – Jun 23, 2016 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: fix oops caused by wrong rtnl dellink usage

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 993e6f2fd ("can: fix oops caused by wrong rtnl newlink usage") but for dellink.

---
 drivers/net/can/dev.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/can/dev.c +6 -0
index 910c12e..b1dc109 100644
@@ -1008,6 +1008,11 @@ static int can_newlink(struct net *src_net, struct net_device *dev,
 	return -EOPNOTSUPP;
 }
 
+static void can_dellink(struct net_device *dev, struct list_head *head)
+{
+	return;
+}
+
 static struct rtnl_link_ops can_link_ops __read_mostly = {
 	.kind		= "can",
 	.maxtype	= IFLA_CAN_MAX,
@@ -1016,6 +1021,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = {
 	.validate	= can_validate,
 	.newlink	= can_newlink,
 	.changelink	= can_changelink,
+	.dellink	= can_dellink,
 	.get_size	= can_get_size,
 	.fill_info	= can_fill_info,
 	.get_xstats_size = can_get_xstats_size,
Signature · 1 line
2.8.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Oliver Hartkopp

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 ...

Quoted 8 lines

This patch adds a private dellink function for the CAN device driver interface that does just nothing.

It's a follow up to commit 993e6f2fd ("can: fix oops caused by wrong rtnl newlink usage") but for dellink.

Applied to can + stable on Cc.

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#2 lore raw

Hi Marc,

I sent two fixes reported by ajneu.

You probably missed this one

http://marc.info/?l=linux-can&m=146650412017263&w=2

which is a stable candidate too.

Regards,
Oliver

Quoted 19 lines · Marc Kleine-Budde
Quoted 4 lines · Oliver Hartkopp

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 ...

Quoted 8 lines

This patch adds a private dellink function for the CAN device driver interface that does just nothing.

It's a follow up to commit 993e6f2fd ("can: fix oops caused by wrong rtnl newlink usage") but for dellink.

Applied to can + stable on Cc.

Tnx,
Marc