Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbbLNHR6 (ORCPT ); Mon, 14 Dec 2015 02:17:58 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:53978 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752559AbbLNHR4 (ORCPT ); Mon, 14 Dec 2015 02:17:56 -0500 X-AuditID: cbfec7f4-f79026d00000418a-7a-566e6d21cb86 From: Pavel Fedin To: "'Greg Kroah-Hartman'" , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, "'David S. Miller'" References: <20151212200536.761001328@linuxfoundation.org> <20151212200537.902715389@linuxfoundation.org> In-reply-to: <20151212200537.902715389@linuxfoundation.org> Subject: RE: [PATCH 4.3 23/71] net: thunder: Check for driver data in nicvf_remove() Date: Mon, 14 Dec 2015 10:17:52 +0300 Message-id: <00bf01d1363f$8c5252e0$a4f6f8a0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQF8ZiB2faUDVmDFP6x0Quag53kuHgH+QUXMn2O/3JA= Content-language: ru X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOLMWRmVeSWpSXmKPExsVy+t/xq7qKuXlhBi/maVjMOd/CYtG8eD2b xeVdc9gsFmx8xOjA4rFl5U0mj/1z17B7fN4kF8AcxWWTkpqTWZZapG+XwJVx+PR3loJm4Yrd LScZGxif8HcxcnJICJhItD98yARhi0lcuLeerYuRi0NIYCmjxJ+73xghnO+MEpcevgOrYhNQ lzj99QMLiC0iECrxf3czK4jNLOAqMePwZnYQW0ggW2LvrIdgNZwC1hLvvtwGs4UFwiS2HOtj BrFZBFQljh25xwZi8wpYSjQ/nc4KYQtK/Jh8jwVippbE+p3HmSBseYnNa94yQ1yqILHj7GtG iBusJCZtvMMGUSMiMe3fPeYJjEKzkIyahWTULCSjZiFpWcDIsopRNLU0uaA4KT3XUK84Mbe4 NC9dLzk/dxMjJPi/7GBcfMzqEKMAB6MSD2/GstwwIdbEsuLK3EOMEhzMSiK8CVZ5YUK8KYmV ValF+fFFpTmpxYcYpTlYlMR55+56HyIkkJ5YkpqdmlqQWgSTZeLglGpgjFXe+W2yksOyBc0b DmTVTtLm5rr4zasu0WLt9G+XbJOdRM6+uhY3UYJhI+c75gNHPufHbcgtd7916SXvJ6P1bFue 3228v9hhae+peVN3fLzk59Ok4u/k3tNbwcW14dedg3Hx3povFE4cVVmhsKozaHEUw/x526eL nTvy2rHMzLhMxWrNBF6+HiWW4oxEQy3mouJEAOMXmbd6AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2620 Lines: 66 Hello! It's good to apply this to stable, however IMHO commit message should be changed. Actually, this was fix for a fix, so in theory 5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206 and 7750130d93decff06120df0d8ea024ff8a038a21 should have been squashed together. You can take a commit message from 5883d9c6d7e680bcdc7a8a9ed2509cd10dd98206, it better explains what was actually done and why. There's also a clean patch: https://www.mail-archive.com/netdev@vger.kernel.org/msg87010.html, which was not applied because v1 was already applied and David doesn't revert commits. Kind regards, Pavel Fedin Expert Engineer Samsung Electronics Research center Russia > -----Original Message----- > From: Greg Kroah-Hartman [mailto:gregkh@linuxfoundation.org] > Sent: Saturday, December 12, 2015 11:06 PM > To: linux-kernel@vger.kernel.org > Cc: Greg Kroah-Hartman; stable@vger.kernel.org; Pavel Fedin; David S. Miller > Subject: [PATCH 4.3 23/71] net: thunder: Check for driver data in nicvf_remove() > > 4.3-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > 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 | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > --- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c > +++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c > @@ -1583,8 +1583,14 @@ 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 net_device *pnetdev = nic->pnicvf->netdev; > + struct nicvf *nic; > + struct net_device *pnetdev; > + > + if (!netdev) > + return; > + > + nic = netdev_priv(netdev); > + pnetdev = nic->pnicvf->netdev; > > /* Check if this Qset is assigned to different VF. > * If yes, clean primary and all secondary Qsets. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/