[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200501213111.GF37466@atomide.com>
Date: Fri, 1 May 2020 14:31:11 -0700
From: Tony Lindgren <tony@...mide.com>
To: Pavel Machek <pavel@...x.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Johan Hovold <johan@...nel.org>, Rob Herring <robh@...nel.org>,
Alan Cox <gnomes@...rguk.ukuu.org.uk>,
Lee Jones <lee.jones@...aro.org>, Jiri Slaby <jslaby@...e.cz>,
Merlijn Wajer <merlijn@...zup.org>,
Peter Hurley <peter@...leysoftware.com>,
Sebastian Reichel <sre@...nel.org>,
linux-serial@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org
Subject: Re: [PATCH 1/6] tty: n_gsm: Add support for serdev drivers
* Pavel Machek <pavel@...x.de> [200501 20:32]:
> > +static struct gsm_dlci *gsd_dlci_get(struct gsm_serdev *gsd, int line,
> > + bool allocate)
> > +{
> > + struct gsm_mux *gsm;
> > + struct gsm_dlci *dlci;
> > +
> > + if (!gsd || !gsd->gsm)
> > + return ERR_PTR(-ENODEV);
> > +
> > + gsm = gsd->gsm;
> > +
> > + if (line < 1 || line >= 63)
> > + return ERR_PTR(-EINVAL);
> > +
> > + mutex_lock(&gsm->mutex);
> ...
> > + dlci = gsm_dlci_alloc(gsm, line);
> > + if (!dlci) {
> > + gsm = ERR_PTR(-ENOMEM);
> > + goto unlock;
>
> dlci = , or you get nice crash.
Ah thanks yeah we return dlci and need to set dlci instead:
if (!dlci) {
dlci = ERR_PTR(-ENOMEM);
goto unlock;
}
Regards,
Tony
Powered by blists - more mailing lists