[PATCH 2/2] staging: vme: fix loop condition

Martyn Welch martyn.welch at ge.com
Wed Feb 23 17:01:03 UTC 2011


On 23/02/11 13:25, Manohar Vanga wrote:
> Fix loop condition in vme_register_bridge that results in an infinite
> loop in the event that device_register fails.
> 
> Signed-off-by: Manohar Vanga <manohar.vanga at cern.ch>

Acked-by: Martyn Welch <martyn.welch at ge.com>

> ---
>  drivers/staging/vme/vme.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
> index 88bf455..c1ec230 100644
> --- a/drivers/staging/vme/vme.c
> +++ b/drivers/staging/vme/vme.c
> @@ -1364,7 +1364,7 @@ int vme_register_bridge(struct vme_bridge *bridge)
>  	return retval;
>  
>  err_reg:
> -	while (i > -1) {
> +	while (--i >= 0) {
>  		dev = &bridge->dev[i];
>  		device_unregister(dev);
>  	}


-- 
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms                   | Wales (3828642) at 100
T +44(0)127322748                          | Barbirolli Square, Manchester,
E martyn.welch at ge.com                      | M2 3AB  VAT:GB 927559189



More information about the devel mailing list