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: <20140114084050.70a612af@jpm-OptiPlex-GX620>
Date:	Tue, 14 Jan 2014 08:40:50 +0200
From:	Jack Morgenstein <jackm@....mellanox.co.il>
To:	Paul Bolle <pebolle@...cali.nl>
Cc:	Or Gerlitz <ogerlitz@...lanox.com>,
	Rony Efraim <ronye@...lanox.com>,
	Hadar Hen Zion <hadarh@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] net/mlx4_core: clean up srq_res_start_move_to()

On Tue, 07 Jan 2014 14:02:14 +0100
Paul Bolle <pebolle@...cali.nl> wrote:

> diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
> b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index
> a41f01e..8ace450 100644 ---
> a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++
> b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -1372,7
> +1372,7 @@ static int cq_res_start_move_to(struct mlx4_dev *dev, int
> slave, int cqn, } 
>  static int srq_res_start_move_to(struct mlx4_dev *dev, int slave,
> int index,
> -				 enum res_cq_states state, struct res_srq **srq)
> +				 enum res_srq_states state, struct res_srq **srq) {

ACK


> +		/* state == RES_SRQ_HW */
> +		if (r->com.state != RES_SRQ_ALLOCATED)

if (state != RES_SRQ_HW || r->com.state != RES_SRQ_ALLOCATED)

>  			err = -EINVAL;
> -		}
> +	}
>  
> -		if (!err) {
> -			r->com.from_state = r->com.state;
> -			r->com.to_state = state;
> -			r->com.state = RES_SRQ_BUSY;
> -			if (srq)
> -				*srq = r;
> -		}
> +	if (!err) {
> +		r->com.from_state = r->com.state;
> +		r->com.to_state = state;
> +		r->com.state = RES_SRQ_BUSY;
	please leave in the if (srq). Not currently needed, but if this
	changes in the future, we will get an Oops.
> +		*srq = r;
>  	}
>  
>  	spin_unlock_irq(mlx4_tlock(dev));

--
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