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]
Message-ID: <55F1CBB3.6060309@redhat.com>
Date:	Thu, 10 Sep 2015 14:28:03 -0400
From:	Jarod Wilson <jarod@...hat.com>
To:	"Rustad, Mark D" <mark.d.rustad@...el.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] igb: don't unmap hw_addr if its NULL

Rustad, Mark D wrote:
>> On Sep 9, 2015, at 9:07 PM, Jarod Wilson<jarod@...hat.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.

Ah, you're right, that had crossed my mind briefly as well. I've got a 
revised version here now that adds an io_addr to igb_adapter and uses 
that for unmap. I'll post it after I double-check that it builds and 
functions as expected.

-- 
Jarod Wilson
jarod@...hat.com


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ