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] [day] [month] [year] [list]
Message-ID: <4BFE2549.4000403@ge.com>
Date:	Thu, 27 May 2010 08:54:49 +0100
From:	Martyn Welch <martyn.welch@...com>
To:	Julia Lawall <julia@...u.dk>
CC:	Greg Kroah-Hartman <gregkh@...e.de>, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 16/17] drivers/staging/vme/bridges: Add missing unlocks

Julia Lawall wrote:
> From: Julia Lawall <julia@...u.dk>
>
> Add a spin_unlock and mutex_unlock missing on the error path.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression E1;
> @@
>
> * spin_lock(E1,...);
>   <+... when != E1
>   if (...) {
>     ... when != E1
> *   return ...;
>   }
>   ...+>
> * spin_unlock(E1,...);
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@...u.dk>
>   

Good catch.

Signed-off-by: Martyn Welch <martyn.welch@...com>


> ---
>  drivers/staging/vme/bridges/vme_ca91cx42.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
> index 0c82eb4..f38f7b7 100644
> --- a/drivers/staging/vme/bridges/vme_ca91cx42.c
> +++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
> @@ -900,7 +900,8 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
>  	/* Address must be 4-byte aligned */
>  	if (pci_addr & 0x3) {
>  		dev_err(dev, "RMW Address not 4-byte aligned\n");
> -		return -EINVAL;
> +		result = -EINVAL;
> +		goto out;
>  	}
>  
>  	/* Ensure RMW Disabled whilst configuring */
> @@ -921,6 +922,7 @@ unsigned int ca91cx42_master_rmw(struct vme_master_resource *image,
>  	/* Disable RMW */
>  	iowrite32(0, bridge->base + SCYC_CTL);
>  
> +out:
>  	spin_unlock(&(image->lock));
>  
>  	mutex_unlock(&(bridge->vme_rmw));
> _______________________________________________
> devel mailing list
> devel@...uxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
>   


-- 
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@...com                        |   M2 3AB  VAT:GB 927559189

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