Re: [PATCH] spi: fix reference leak in spi_register_controller()

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

 



On Tue, Dec 17, 2024 at 03:31:33PM +0800, Ma Ke wrote:
> Once device_add() failed, we should call put_device() to decrement
> reference count for cleanup. Or it could cause memory leak.
> 
> Found by code review.

This isn't clear to me, spi_register_controller() is analogous to
device_add() and __spi_alloc_controller() is analogous to (and wraps)
device_initialize() so I'd expect the _put() to be done by the caller
calling spi_controller_put() either directly or more usually via devm.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux