[Intel-wired-lan] [PATCH] igb: don't unmap hw_addr if its NULL

Rustad, Mark D mark.d.rustad at intel.com
Thu Sep 10 17:55:54 UTC 2015


> On Sep 9, 2015, at 9:07 PM, Jarod Wilson <jarod at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20150910/f8443674/attachment.asc>


More information about the Intel-wired-lan mailing list