Re: [PATCH 1/4] parport: modify parport subsystem to use devicemodel

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

 



On Wed, Apr 15, 2015 at 12:45:00PM +0300, Dan Carpenter wrote:
> On Wed, Apr 15, 2015 at 02:50:55PM +0530, Sudip Mukherjee wrote:
> > <snip>
> > > > +	tmp->name = name;
> > > 
> > > I wonder who frees this name variable.  My concern is that it gets
> > > freed before we are done using it or something.  (I have not looked at
> > > the details).
> > it will be done in free_port() the release callback of parport device.
> 
> That doesn't work.  Some of the callers pass a string literal.
oops, when i replied to your first mail about this I looked at
parport_register_port(), but the one that you have mentioned is the one
I gave in parport_register_dev() and it seems that the name is not freed
anywhere except the driver that has called parport_register_device() or
parport_register_dev(). I think I should better copy it and then give it
to tmp->name and free it also in the unregister function. And this should
be fixed in the original parport_register_device() also.
I will wait for some more reviews send the v2 series tomorrow.

regards
sudip

> 
> regards,
> dan carpenter
> 
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux