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]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux