lkml.org 
[lkml]   [2020]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/6] tty: n_gsm: Add support for serdev drivers
    * Pavel Machek <pavel@denx.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

    \
     
     \ /
      Last update: 2020-05-01 23:32    [W:4.564 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site