Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222337

Re: [PATCH] igb: don't unmap hw_addr if its NULL

From "Rustad, Mark D" <mark.d.rustad@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] igb: don't unmap hw_addr if its NULL
Date 2015-09-10 20:00 +0200
Message-ID <q7eiC-eo-13@gated-at.bofh.it> (permalink)
References <q71ln-7gf-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

> On Sep 9, 2015, at 9:07 PM, Jarod Wilson <jarod@redhat.com> wrote:
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index e174fbb..a5e0022 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -2823,7 +2823,8 @@ static void igb_remove(struct pci_dev *pdev)
> 
> 	igb_clear_interrupt_scheme(adapter);
> 
> -	pci_iounmap(pdev, hw->hw_addr);
> +	if (hw->hw_addr)
> +		pci_iounmap(pdev, hw->hw_addr);
> 	if (hw->flash_address)
> 		iounmap(hw->flash_address);
> 	pci_release_selected_regions(pdev,

I don't think that this is entirely the right solution. In ixgbe we have a separate pointer, io_addr, used to manage the resource, so that the space can be freed even after hw_addr is cleared. With the approach above, the pci_iounmap will not ever be called on the space. You can see how ixgbe is doing it.

--
Mark Rustad, Networking Division, Intel Corporation

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] igb: don't unmap hw_addr if its NULL Jarod Wilson <jarod@redhat.com> - 2015-09-10 06:10 +0200
  RE: [Intel-wired-lan] [PATCH] igb: don't unmap hw_addr if its NULL "Fujinaka, Todd" <todd.fujinaka@intel.com> - 2015-09-10 18:00 +0200
  Re: [PATCH] igb: don't unmap hw_addr if its NULL "Rustad, Mark D" <mark.d.rustad@intel.com> - 2015-09-10 20:00 +0200
    Re: [PATCH] igb: don't unmap hw_addr if its NULL Jarod Wilson <jarod@redhat.com> - 2015-09-10 20:30 +0200
    [PATCH v2] igb: don't unmap NULL hw_addr Jarod Wilson <jarod@redhat.com> - 2015-09-10 21:40 +0200

csiph-web