[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171018070157.GC5638@localhost>
Date: Wed, 18 Oct 2017 09:01:57 +0200
From: Johan Hovold <johan@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] serdev: ttyport: add missing open() error handling
On Tue, Oct 17, 2017 at 11:08:53AM -0500, Rob Herring wrote:
> On Mon, Oct 16, 2017 at 8:06 AM, Johan Hovold <johan@...nel.org> wrote:
> > Add missing error handling for tty-driver open() which may fail (e.g. if
> > resource allocation fails or if a port is being disconnected).
> >
> > Note that close() must be called also in case of failed open() and that
> > the operation sanity check is amended to catch buggy drivers.
>
> That's a very odd pattern. Wouldn't a must_check annotation be enough?
An odd pattern indeed, but that's how the TTY drivers are implemented
and the interface documented (i.e. that close() will be called also
after failed open()).
Not sure how a must_check could help here.
Johan
Powered by blists - more mailing lists