Re: [PATCH] drm/nouveau: Fix memory leaks in debugfs and hwmon init error paths

[email protected]
Newsgroups org.freedesktop.lists.dri-devel,org.kernel.vger.linux-hwmon
Message-ID <[email protected]>
> In nouveau_debugfs_init(), if nvif_object_ctor() fails, the previously
> allocated drm->debugfs is leaked because the function returns the
> error code directly.
> 
> In nouveau_hwmon_init(), if hwmon_device_register_with_info() fails,
> the allocated hwmon structure is leaked because the function returns
> the error code directly.
> 
> Fix both by freeing the allocated memory and clearing the pointer on
> the error paths.
> 
> Signed-off-by: liupeng <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.