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]
Date:	Tue, 23 Oct 2007 11:50:16 +0200
From:	Andreas Schwab <schwab@...e.de>
To:	Roel Kluin <12o3l@...cali.nl>
Cc:	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] unlock 12c_mutex before return

Roel Kluin <12o3l@...cali.nl> writes:

>     unlock 12c_mutex before return -EINVAL
>     
>     Signed-off-by: Roel Kluin <12o3l@...cali.nl>
> ---
> diff --git a/drivers/media/dvb/dvb-usb/au6610.c b/drivers/media/dvb/dvb-usb/au6610.c
> index 18e0b16..31f47c7 100644
> --- a/drivers/media/dvb/dvb-usb/au6610.c
> +++ b/drivers/media/dvb/dvb-usb/au6610.c
> @@ -82,8 +82,10 @@ static int au6610_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
>  	if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
>  		return -EAGAIN;
>  
> -	if (num > 2)
> +	if (num > 2) {
> +                mutex_unlock(&d->i2c_mutex);
>  		return -EINVAL;

How about moving the check before the lock?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@...e.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
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