lkml.org 
[lkml]   [2015]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 4.3 23/71] net: thunder: Check for driver data in nicvf_remove()
Date
 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 <p.fedin@samsung.com>
>
> [ 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 <p.fedin@samsung.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> 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.
>




\
 
 \ /
  Last update: 2015-12-14 09:01    [W:0.230 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site