lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a8de1fd5-7eaf-46f8-804a-8b241a3e6448@sirena.org.uk>
Date: Tue, 17 Dec 2024 15:23:30 +0000
From: Mark Brown <broonie@...nel.org>
To: Ma Ke <make_ruc2021@....com>
Cc: aaro.koskinen@...ia.com, linux-spi@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] spi: fix reference leak in spi_register_controller()

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.

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ