lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Aug 2007 18:30:00 +0200
From:	Steffen Klassert <klassert@...hematik.tu-chemnitz.de>
To:	Mark Hindley <mark@...dley.org.uk>
Cc:	Jeff Garzik <jeff@...zik.org>, akpm@...ux-foundation.org,
	netdev@...r.kernel.org
Subject: Re: [patch 08/18] 3c59x: check return of pci_enable_device()

On Tue, Aug 14, 2007 at 10:54:32AM +0100, Mark Hindley wrote:
> On Tue, Aug 14, 2007 at 01:33:26AM -0400, Jeff Garzik wrote:
> > I would strongly prefer that vortex_up return a value, since all the 
> > important callers of this function can themselves return an error back 
> > to the system.
> > 
> > we can definitely return a meaningful return value here, if 
> > pci_enable_device() fails, and I would rather not apply a patch that 
> > fails to propagate a serious condition (pci_enable_device failure is 
> > indeed serious) when it is possible to do so
> > 
> 
> OK. Any comments on this revised version? I have only ignored the return of
> vortex_up in vortex_error. It is not immediately clear what to do if
> vortex_up still fails there after a pci reset.
> 
> Mark
> 
> 
> diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
> index 001c66d..a1dfd6b 100644
> --- a/drivers/net/3c59x.c
> +++ b/drivers/net/3c59x.c
> @@ -705,7 +705,7 @@ static struct {
>  
>  static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
>  				   int chip_idx, int card_idx);
> -static void vortex_up(struct net_device *dev);
> +static int vortex_up(struct net_device *dev);
>  static void vortex_down(struct net_device *dev, int final);
>  static int vortex_open(struct net_device *dev);
>  static void mdio_sync(void __iomem *ioaddr, int bits);
> @@ -841,8 +841,11 @@ static int vortex_resume(struct pci_dev *pdev)
>  			return -EBUSY;
>  		}
>  		if (netif_running(dev)) {
> -			vortex_up(dev);
> -			netif_device_attach(dev);
> +			err = vortex_up(dev);
> +			if (err)
> +				return err;
> +			else  
> +				netif_device_attach(dev);
>  		}
>  	}
>  	return 0;

I think we should free the requested irq if vortex_up really fails here.


Steffen
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists