From: Arjan van de Ven <arjan@infradead.org>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: matthias.kaehlcke@gmail.com
Subject: Re: use mutex instead of semaphore in RocketPort driver
Date: Tue, 22 May 2007 09:59:01 -0700 [thread overview]
Message-ID: <1179853142.3296.1.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <200705081903.l48J3lr1012622@hera.kernel.org>
>
> - down_interruptible(&info->write_sem);
> + mutex_lock_interruptible(&info->write_mtx);
>
> #ifdef ROCKET_DEBUG_WRITE
> printk(KERN_INFO "rp_write %d chars...", count);
> @@ -1773,7 +1776,7 @@ end:
> wake_up_interruptible(&tty->poll_wait);
> #endif
> }
> - up(&info->write_sem);
> + mutex_unlock(&info->write_mtx);
> return retval
this code is very very buggy.
mutex_lock_interruptible() may not get the mutex in case a signal
happens... and yet you unlox the mutex unconditionally!!!
next parent reply other threads:[~2007-05-22 17:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200705081903.l48J3lr1012622@hera.kernel.org>
2007-05-22 16:59 ` Arjan van de Ven [this message]
2007-05-22 20:06 ` Matthias Kaehlcke
2007-05-22 21:04 ` Simon Arlott
2007-05-22 21:23 ` Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1179853142.3296.1.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.kaehlcke@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®