> 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.
> 
> Fixes: b126a200e9db ("drm/nouveau/debugfs: we need a ctrl object for debugfs")
> Fixes: b9ed919f1c8f ("drm/nouveau/drm/pm: remove everything except the hwmon 
> interfaces to THERM")
> Cc: [email protected]
> 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

Reply via email to