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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120208.200602.200734891435792991.davem@davemloft.net>
Date:	Wed, 08 Feb 2012 20:06:02 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	vfalico@...hat.com
Cc:	netdev@...r.kernel.org, toshiharu-linux@....okisemi.com,
	paul.gortmaker@...driver.com, mirq-linux@...e.qmqm.pl
Subject: Re: pch_gbe: set dma mask to only 32 bit

From: Veaceslav Falico <vfalico@...hat.com>
Date: Tue, 7 Feb 2012 20:23:54 +0100

> Because pch_gbe_rx_desc->buffer_addr is u32, we cannot set dma mask to 64
> bit or otherwise we could end up loosing the higher 32 bit from the return
> of dma_map_single(). Removing DMA_BIT_MASK(64) setting will solve it.
> 
> Signed-off-by: Veaceslav Falico <vfalico@...hat.com>

The logic here makes no sense.

> -	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))
> -		|| pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
> -		ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
> +	if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
> +		ret = pci_set_consistent_dma_mask(pdev,
> +						  DMA_BIT_MASK(32));

You want to take this branch on success, not failure.  pci_set_dma_mask()
returns 0 on success.

Something like:

	ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
	if (ret ||
	    (ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))) {
		dev_err(&pdev->dev, "ERR: No usable DMA "
			"configuration, aborting\n");
		goto err_disable_device;
	}
--
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