From: Thomas Gleixner <tglx@linutronix.de>
To: J Freyensee <james_p_freyensee@linux.intel.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org,
suhail.ahmed@intel.com, christophe.guerard@intel.com
Subject: Re: [PATCH 09/10] n_tracerouter ldisc driver.
Date: Thu, 24 Feb 2011 21:27:28 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.1102242125410.2701@localhost6.localdomain6> (raw)
In-Reply-To: <1298578810.2315.70.camel@localhost>
On Thu, 24 Feb 2011, J Freyensee wrote:
> > > +
> > > + mutex_lock(&routelock);
> > > + if (tr_data->opencalled == 0) {
> > > +
> > > + tr_data->kref_tty = tty_kref_get(tty);
> > > + if (tr_data->kref_tty == NULL)
> > > + retval = -EFAULT;
> > > + else {
> >
> > Please use braces for the if as well. It's just irritating not to have
> > them before the else.
>
> checkpatch.pl did not care about the lack of braces so that is why this
> got missed; I can add it.
It's not a strict requirement, but add it and look at the result. Then
judge yourself.
> > +static void n_tracerouter_close(struct tty_struct *tty)
> > > +{
> > > + struct tracerouter_data *tptr = tty->disc_data;
> > > +
> > > + WARN_ON(tptr->kref_tty != tr_data->kref_tty);
> > > + tty_driver_flush_buffer(tty);
> >
> > That code probably never run with lockdep as you would get a potential
> > deadlock warning. See n_tracerouter_open().
> >
> > Though the deadlock cannot happen as you are protected by
> > tr_data->opencalled it does not make it more correct.
> >
>
> What do you suggest to make it correct for upstream?
Keep the lock ordering consistent. Either call that under the lock
always or do not.
Thanks,
tglx
prev parent reply other threads:[~2011-02-24 20:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-24 18:07 james_p_freyensee
2011-02-24 19:20 ` Thomas Gleixner
2011-02-24 20:20 ` J Freyensee
2011-02-24 20:27 ` Thomas Gleixner [this message]
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=alpine.LFD.2.00.1102242125410.2701@localhost6.localdomain6 \
--to=tglx@linutronix.de \
--cc=christophe.guerard@intel.com \
--cc=gregkh@suse.de \
--cc=james_p_freyensee@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=suhail.ahmed@intel.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®