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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux