diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-01-29 01:51:20 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2024-01-29 01:51:20 +0000 |
commit | 18ea65473a7d5ebf963b355f6a88da2a2b4d0127 (patch) | |
tree | e640229d2d7d01d9b8faf96c0ae339d6122ce011 /sys/dev | |
parent | 7f6e1e437230720c38373dd28a53be1072f8beb1 (diff) |
drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init
From Zhipeng Lu
ae7cbf935b9a1b41f65fe6443e7cd0c401500b20 in linux-6.6.y/6.6.14
2f3be3ca779b11c332441b10e00443a2510f4d7b in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c index 120354c1e07..6fabd1eaa9f 100644 --- a/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +++ b/sys/dev/pci/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c @@ -2974,6 +2974,8 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr) result = smu7_get_evv_voltages(hwmgr); if (result) { pr_info("Get EVV Voltage Failed. Abort Driver loading!\n"); + kfree(hwmgr->backend); + hwmgr->backend = NULL; return -EINVAL; } } else { @@ -3019,8 +3021,10 @@ static int smu7_hwmgr_backend_init(struct pp_hwmgr *hwmgr) } result = smu7_update_edc_leakage_table(hwmgr); - if (result) + if (result) { + smu7_hwmgr_backend_fini(hwmgr); return result; + } return 0; } |