mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
All created csrow objects must be removed in the error path of
edac_create_csrow_objects(). The objects have been added as devices.
They need to be removed by doing a device_del() *and* put_device() call
to also free their memory. The missing put_device() leaves a memory
leak. Use device_unregister() instead of device_del() which properly
unregisters the device doing both.
Fixes: 7adc05d2dc ("EDAC/sysfs: Drop device references properly")
Signed-off-by: Robert Richter <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Tested-by: John Garry <[email protected]>
Cc: <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]