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:	Thu, 16 Aug 2007 01:38:02 -0700
From:	"Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@...el.com>
To:	"Brandon Philips" <bphilips@...e.de>, <netdev@...r.kernel.org>,
	<e1000-devel@...ts.sourceforge.net>
Cc:	<teheo@...e.de>
Subject: RE: [patch 4/4] Update e1000 driver to use devres.

> Index: linux-2.6/drivers/net/e1000/e1000_main.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/e1000/e1000_main.c
> +++ linux-2.6/drivers/net/e1000/e1000_main.c
> @@ -860,15 +860,14 @@ e1000_probe(struct pci_dev *pdev,  {
>  	struct net_device *netdev;
>  	struct e1000_adapter *adapter;
> -	unsigned long mmio_start, mmio_len;
> -	unsigned long flash_start, flash_len;
> +	unsigned long mmio_len, flash_len;
>  
>  	static int cards_found = 0;
>  	static int global_quad_port_a = 0; /* global ksp3 port 
> a indication */
>  	int i, err, pci_using_dac;
>  	uint16_t eeprom_data = 0;
>  	uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
> -	if ((err = pci_enable_device(pdev)))
> +	if ((err = pcim_enable_device(pdev)))
>  		return err;
>  
>  	if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) && 
> @@ -878,20 +877,19 @@ e1000_probe(struct pci_dev *pdev,
>  		if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) &&
>  		    (err = pci_set_consistent_dma_mask(pdev, 
> DMA_32BIT_MASK))) {
>  			E1000_ERR("No usable DMA configuration, 
> aborting\n");
> -			goto err_dma;
> +			return err;
>  		}
>  		pci_using_dac = 0;
>  	}
>  
>  	if ((err = pci_request_regions(pdev, e1000_driver_name)))
> -		goto err_pci_reg;
> +		return err;
>  
>  	pci_set_master(pdev);
>  
> -	err = -ENOMEM;
> -	netdev = alloc_etherdev(sizeof(struct e1000_adapter));
> +	netdev = devm_alloc_etherdev(&pdev->dev, sizeof(struct 
> +e1000_adapter));
>  	if (!netdev)
> -		goto err_alloc_etherdev;
> +		return -ENOMEM;

I'm a bit confused why you removed the goto's, and then removed all the
target unwinding code at the bottom of e1000_probe().   Those labels
clean up resources if something fails, like the err_sw_init label.  I
don't see anything in the devres code that jumps out at me that explains
why we can do away with these cleanup routines.  Thoughts?

Thanks,
-PJ Waskiewicz
-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ