diff options
| author | Prasanna Kumar T S M <ptsm@linux.microsoft.com> | 2026-11-18 19:50:25 +0530 |
|---|---|---|
| committer | Borislav Petkov (AMD) <bp@alien8.de> | 2026-11-23 17:50:16 -0800 |
| commit | d34d54bb9bbe57c648f68819dd520995618eb196 (patch) | |
| tree | 8f8c7c72bf01a8567cb1c1c72a48642bc552bbce /tools/lib/python | |
| parent | b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f (diff) | |
EDAC/versalnet: Fix device_register() error handling in init_one_mc()
When device_register() fails, it must be followed by put_device() rather than
kfree(), because device_register() calls device_initialize() which sets up the
device refcount. The matching release function versal_edac_release() handles
the actual kfree().
To simplify error handling and avoid complex unwinding, split device_register()
into device_initialize() and device_add(). Initialize the device early so
put_device() can be used in all error paths.
Fixes: d5fe2fec6c40 ("EDAC: Add a driver for the AMD Versal NET DDR controller")
Signed-off-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
Co-developed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261118142213.100581-2-shubhrajyoti.datta@amd.com
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
