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: <20160427063254.GM7974@leon.nu>
Date:	Wed, 27 Apr 2016 09:32:54 +0300
From:	Leon Romanovsky <leon@...nel.org>
To:	Haggai Abramovsky <hagaya@...lanox.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
	netdev@...r.kernel.org, Sinan Kaya <okaya@...eaurora.org>,
	Timur Tabi <timur@...eaurora.org>,
	Eli Cohen <eli@...lanox.com>,
	Or Gerlitz <ogerlitz@...lanox.com>,
	Eran Ben Elisha <eranbe@...lanox.com>,
	Yishai Hadas <yishaih@...lanox.com>,
	Tal Alon <talal@...lanox.com>,
	Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH net] net/mlx4: Avoid wrong virtual mappings

On Mon, Apr 25, 2016 at 04:34:47PM +0300, Haggai Abramovsky wrote:
> -int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
> -		   struct mlx4_buf *buf, gfp_t gfp)
> +static int mlx4_buf_direct_alloc(struct mlx4_dev *dev, int size,
> +				 struct mlx4_buf *buf, gfp_t gfp)
>  {
> -	dma_addr_t t;
> +		dma_addr_t t;
>  

You have wrong indentation in whole this function.

> -	if (size <= max_direct) {
>  		buf->nbufs        = 1;
>  		buf->npages       = 1;
>  		buf->page_shift   = get_order(size) + PAGE_SHIFT;
> -		buf->direct.buf   = dma_alloc_coherent(&dev->persist->pdev->dev,
> -						       size, &t, gfp);
> +		buf->direct.buf   =
> +			dma_zalloc_coherent(&dev->persist->pdev->dev,
> +					    size, &t, gfp);
>  		if (!buf->direct.buf)
>  			return -ENOMEM;

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ