From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:60574 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbcHRMt6 (ORCPT ); Thu, 18 Aug 2016 08:49:58 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: Oliver Hartkopp , Marc Kleine-Budde , Jiri Slaby Subject: [patch added to 3.12-stable] can: fix oops caused by wrong rtnl dellink usage Date: Thu, 18 Aug 2016 14:49:09 +0200 Message-Id: <20160818124953.31969-4-jslaby@suse.cz> In-Reply-To: <20160818124953.31969-1-jslaby@suse.cz> References: <20160818124953.31969-1-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Oliver Hartkopp This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== 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 993e6f2fd ("can: fix oops caused by wrong rtnl newlink usage") but for dellink. Reported-by: ajneu Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde Signed-off-by: Jiri Slaby --- drivers/net/can/dev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 3c1a7f8211be..561bed7eb6a5 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -775,6 +775,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, @@ -782,6 +787,7 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { .setup = can_setup, .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, -- 2.9.3