Re: [PATCH] staging: comedi: have comedi_set_spriv() allocate the memory

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

 



[Originally posted 2013-06-20.  Reposting to new driverdev-devel list.]

On 2013/06/19 11:24 PM, H Hartley Sweeten wrote:
As suggested by Ian Abbott, comedi_set_spriv() can only be used to
set the subdevice->private pointer to something that can be kfree()'d.
Rename the function to comedi_alloc_spriv() and have it kzalloc() the
memory as well as set the private pointer. This saves a function call
in the drivers and avoids the possibility of incorrectly calling
comedi_set_spriv() for some pointer that is not meant to be kfree()'d.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Looks good.

Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>             )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587              )=-
_______________________________________________
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