Re: [PATCH 1/6] tty: n_gsm: Add support for serdev drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Pavel Machek <pavel@xxxxxxx> [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



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux