Re: Possible memory leak in acm_probe not freeing (acm->country_codes) on error path

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

 



On Thu, 20 Nov 2014, Oliver Neukum wrote:

> On Thu, 2014-11-20 at 15:36 +0100, Bjørn Mork wrote:
> > Oliver Neukum <oneukum@xxxxxxx> writes:
> > > On Thu, 2014-11-20 at 15:09 +0100, Bjørn Mork wrote:
> > >> Oliver Neukum <oneukum@xxxxxxx> writes:
> > >> > On Thu, 2014-11-20 at 14:27 +0100, Johan Hovold wrote:
> > >> >
> > >> >> It looks like it's never freed in the alloc_fail8 error path of probe,
> > >> >> though.
> > >> >
> > >> > Indeed. A case of the coder being blind to his own code.
> > >> > Patch is forthcoming.
> > >> 
> > >> Why does the driver have to allocate anything at all for this purpose?
> > >> Couldn't it just save a pointer to the country functional descriptor,
> > >> and let the "show" functions decode that when necessary?
> > >
> > > The show method would have to deal with a race against disconnect().
> > 
> > How is that different with the additional allocation?
> 
> Good question. That was the original motivation. Sysfs attributes are
> just a pain. Let me think.

The sysfs filesystem itself insures that sysfs attributes never race 
with device removal.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux