From: Okash Khawaja <okash.khawaja@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
Kirk Reiser <kirk@reisers.ca>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"speakup@linux-speakup.org" <speakup@linux-speakup.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jiri Slaby <jslaby@suse.com>,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
Chris Brannon <chris@the-brannons.com>
Subject: Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export
Date: Tue, 18 Jul 2017 20:22:59 +0100 [thread overview]
Message-ID: <20170718192259.GA2799@sanghar> (raw)
In-Reply-To: <20170718122637.l5v3re2gcjbxkzeq@mwanda>
On Tue, Jul 18, 2017 at 03:26:37PM +0300, Dan Carpenter wrote:
> > + if (tty) {
> > + /* drop kref from tty_driver_lookup_tty() */
> > + tty_kref_put(tty);
> > + tty = ERR_PTR(-EBUSY);
> > + } else { /* tty_init_dev returns tty with the tty_lock held */
> > + tty = tty_init_dev(driver, index);
> > + tty_port_set_kopened(tty->port, 1);
> ^^^^^^^^^
>
> tty_init_dev() can fail leading to an error pointer dereference here.
Thanks very much. I will check for error pointer here.
Okash
next prev parent reply other threads:[~ UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
Okash Khawaja
[not found] ` <20170708083803.GA23080@kroah.com>
` Okash Khawaja
` [patch 0/3] " Okash Khawaja
` [patch 1/3] tty: resolve tty contention between kernel and user space Okash Khawaja
[not found] ` <CAHp75VdwWNj8PHRAMLqcQKhtT=sS5-n9T3n8GY1Rte=MKOQV-w@mail.gmail.com>
` Okash Khawaja
` Okash Khawaja
[not found] ` <CAHp75VeEjExnouxPqxPg8uVBJXRiWOpLSSypeDMNTheD3aJLNg@mail.gmail.com>
` Okash Khawaja
` [patch 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver Okash Khawaja
[not found] ` <20170709115055.GA14769@kroah.com>
` Okash Khawaja
` [patch 3/3] tty: undo export " Okash Khawaja
` [patch 4/3] tty: make tty_kopen return ENODEV in case of no TTY Okash Khawaja
[not found] ` <20170710125233.2006733e@alans-desktop>
` [patch 0/3] Re: tty contention resulting from tty_open_by_device export Okash Khawaja
` Okash Khawaja
[not found] ` <20170712192028.70bc0d54@alans-desktop>
` Okash Khawaja
[not found] ` <20170717123145.GE24503@kroah.com>
` Okash Khawaja
[not found] ` <20170717230438.5c3bd397@alans-desktop>
` Okash Khawaja
[not found] ` <20170718122637.l5v3re2gcjbxkzeq@mwanda>
` Okash Khawaja [this message]
` [patch v2 0/3] tty contention resulting from tty_open_by_driver export Okash Khawaja
` [patch v2 1/3] tty: resolve tty contention between kernel and user space Okash Khawaja
` [patch v2 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver Okash Khawaja
` [patch v2 3/3] tty: undo export " Okash Khawaja
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=20170718192259.GA2799@sanghar \
--to=okash.khawaja@gmail.com \
--cc=chris@the-brannons.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kirk@reisers.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=speakup@linux-speakup.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).