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: <alpine.LRH.2.00.0910082046370.12171@twin.jikos.cz>
Date:	Thu, 8 Oct 2009 20:47:25 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Alexander Strakh <strakh@...ras.ru>
Cc:	Vladimir Shebordaev <vshebordaev@...l.ru>,
	Mauro Carvalho Chehab <mchehab@...radead.org>,
	linux-media@...r.kernel.org,
	Linux Kernlel Mailing List <linux-kernel@...r.kernel.org>,
	Hans Verkuil <hverkuil@...all.nl>
Subject: Re: [BUG] radio-gemtek-pci.c: double mutex_lock

On Thu, 8 Oct 2009, Alexander Strakh wrote:

> 	KERNEL_VERSION: 2.6.31
> 	DESCRIBE:
> In driver ./drivers/media/radio/radio-gemtek-pci.c 
> mutex_lock is called first time in line 184, then in line 186 
> gemtek_pci_setfrequency is called.
> 
> 182 static void gemtek_pci_unmute(struct gemtek_pci *card)
> 183 {
> 184		mutex_lock(&card->lock);
> 185		if (card->mute) {
> 186         	gemtek_pci_setfrequency(card, card->current_frequency);
> 187			card->mute = false;
> 188		}
> 189		mutex_unlock(&card->lock);190 }
> 
> In gemtek_pci_setfrequency we call mutex_lock again in line 152
> 
> 144 static void gemtek_pci_setfrequency(struct gemtek_pci *card, unsigned long 
> frequency)
> 145 {
> 146         int i;
> 147         u32 value = frequency / 200 + 856;
> 148         u16 mask = 0x8000;
> 149         u8 last_byte;
> 150         u32 port = card->iobase;
> 151
> 152         mutex_lock(&card->lock);

Good catch. Adding Hans, who added the (incorrect) locking into 
gemtek_pci_unmute(), to CC.

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

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