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:	Sun, 9 Sep 2007 21:44:38 +0100
From:	Arjan van de Ven <arjan@...radead.org>
To:	"Adrian McMenamin" <lkmladrian@...il.com>
Cc:	"Dmitry Torokhov" <dtor@...ightbb.com>,
	"Paul Mundt" <lethal@...ux-sh.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] Maple bus support for the Sega Dreamcast - keyboard
 support

On Sun, 9 Sep 2007 21:35:11 +0100
"Adrian McMenamin" <lkmladrian@...il.com> wrote:

> On 09/09/07, Arjan van de Ven <arjan@...radead.org> wrote:
> > On Sun, 9 Sep 2007 18:01:26 +0100
> > "Adrian McMenamin" <lkmladrian@...il.com> wrote:
> >
> > > This patch adds support for the SEGA Dreamcast keyboard.
> > >
> > > Following suggestions from the inout maintainer it has been
> > > somewhat rewritten since the previous posting
> > > (http://lkml.org/lkml/2007/9/4/168).
> >
> > Hi,
> >
> > this driver in general is quite clean as well; I have only one
> > suggestion for improvement. Right now you use a semaphore for
> > locking, while all you really use it for is mutex semantics, I
> > think it would be a good idea to convert the driver to use the
> > actual mutex primitive; this will buy you a lot of extra automatic
> > checking for bugs...
> >
> > Greetings,
> >    Arjan van de Ven
> >
> 
> OK... here's a redone patch:
> +	unsigned long *buf = mq->recvbuf;
> +	if (mutex_trylock(&maple_keyb_mutex)) /* Can only be locked
> if already in cleanup */
> +		return;
> +	if (buf[1] == mapledev->function) {
> 

I think this has a bug; mutex_trylock has the opposite return code as
down_trylock (mutex follows the same convention as the spinlock
trylock).... so you probably need to add a ! here...
-
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