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: <Z-UtHzeewV-CvzfD@kekkonen.localdomain>
Date: Thu, 27 Mar 2025 10:49:03 +0000
From: Sakari Ailus <sakari.ailus@...ux.intel.com>
To: Ma Ke <make24@...as.ac.cn>
Cc: mchehab@...nel.org, hverkuil@...all.nl, sebastian.fricke@...labora.com,
	ribalda@...omium.org, benjamin.gaignard@...labora.com,
	viro@...iv.linux.org.uk, bartosz.golaszewski@...aro.org,
	hljunggr@...co.com, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v3] media: v4l2-dev: fix error handling in
 __video_register_device()

On Wed, Mar 19, 2025 at 04:02:48PM +0800, Ma Ke wrote:
> Once device_register() failed, we should call put_device() to
> decrement reference count for cleanup. Or it could cause memory leak.
> And move callback function v4l2_device_release() and v4l2_device_get()
> before put_device().
> 
> As comment of device_register() says, 'NOTE: _Never_ directly free
> @dev after calling this function, even if it returned an error! Always
> use put_device() to give up the reference initialized in this function
> instead.'
> 
> Found by code review.
> 
> Cc: stable@...r.kernel.org
> Fixes: dc93a70cc7f9 ("V4L/DVB (9973): v4l2-dev: use the release callback from device instead of cdev")
> Signed-off-by: Ma Ke <make24@...as.ac.cn>

Reviewed-by: Sakari Ailus <sakari.ailus@...ux.intel.com>

-- 
Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ