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:	Fri, 06 Mar 2015 00:16:18 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc:	davem@...emloft.net, Anjali Singhai <anjali.singhai@...el.com>,
	netdev@...r.kernel.org, nhorman@...hat.com, sassmann@...hat.com,
	jogreene@...hat.com, Jesse Brandeburg <jesse.brandeburg@...el.com>
Subject: Re: [net-next 11/14] i40e: Ioremap changes

On Thu, 2015-03-05 at 08:46 -0800, Jeff Kirsher wrote:
[...]
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -9459,6 +9459,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	struct i40e_pf *pf;
>  	struct i40e_hw *hw;
>  	static u16 pfs_found;
> +	u32 ioremap_len;
>  	u16 link_status;
>  	int err = 0;
>  	u32 len;
> @@ -9507,8 +9508,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	hw = &pf->hw;
>  	hw->back = pf;
> -	hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
> -			      pci_resource_len(pdev, 0));
> +
> +	ioremap_len = min_t(int, pci_resource_len(pdev, 0),
> +			    I40E_MAX_CSR_SPACE);

What type do you really want ioremap_len to be, u32 or int?  (I think
the correct answer is unsigned long as that's the ioremap() parameter
type.)

Ben.

> +	hw->hw_addr = ioremap(pci_resource_start(pdev, 0), ioremap_len);
>  	if (!hw->hw_addr) {
>  		err = -EIO;
>  		dev_info(&pdev->dev, "ioremap(0x%04x, 0x%04x) failed: 0x%x\n",

-- 
Ben Hutchings
Time is nature's way of making sure that everything doesn't happen at once.

Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ