From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34811 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754358AbbLKUWT (ORCPT ); Fri, 11 Dec 2015 15:22:19 -0500 Subject: Patch "net: thunder: Check for driver data in nicvf_remove()" has been added to the 4.2-stable tree To: p.fedin@samsung.com, davem@davemloft.net, gregkh@linuxfoundation.org Cc: , From: Date: Fri, 11 Dec 2015 08:49:14 -0800 Message-ID: <144985255417174@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled net: thunder: Check for driver data in nicvf_remove() to the 4.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-thunder-check-for-driver-data-in-nicvf_remove.patch and it can be found in the queue-4.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Fri Dec 11 11:38:35 EST 2015 From: Pavel Fedin Date: Mon, 16 Nov 2015 17:51:34 +0300 Subject: net: thunder: Check for driver data in nicvf_remove() From: Pavel Fedin [ Upstream commit 7750130d93decff06120df0d8ea024ff8a038a21 ] In some cases the crash is caused by nicvf_remove() being called from outside. For example, if we try to feed the device to vfio after the probe has failed for some reason. So, move the check to better place. Signed-off-by: Pavel Fedin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/cavium/thunder/nicvf_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c @@ -1325,7 +1325,12 @@ err_disable_device: static void nicvf_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); - struct nicvf *nic = netdev_priv(netdev); + struct nicvf *nic; + + if (!netdev) + return; + + nic = netdev_priv(netdev); unregister_netdev(netdev); nicvf_unregister_interrupts(nic); Patches currently in stable-queue which might be from p.fedin@samsung.com are queue-4.2/net-thunder-check-for-driver-data-in-nicvf_remove.patch