commit | 78570f8873c8cd44c12714c7fa7db2601ec5617d | [log] [tgz] |
---|---|---|
author | Daniel Wagner <dwagner@suse.de> | Fri Feb 12 10:30:15 2021 +0100 |
committer | Christoph Hellwig <hch@lst.de> | Fri Mar 05 13:41:03 2021 +0100 |
tree | 6949049843f73c1a3096f3ec3f28e0f04bafa4e6 | |
parent | 6e6a6828c517fb6819479bf5187df5f39084eb9e [diff] |
nvme-hwmon: Return error code when registration fails The hwmon pointer wont be NULL if the registration fails. Though the exit code path will assign it to ctrl->hwmon_device. Later nvme_hwmon_exit() will try to free the invalid pointer. Avoid this by returning the error code from hwmon_device_register_with_info(). Fixes: ed7770f66286 ("nvme/hwmon: rework to avoid devm allocation") Signed-off-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>