nvme-hwmon: Return error code when registration fails
[ Upstream commit 78570f88 ] 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: ed7770f6 ("nvme/hwmon: rework to avoid devm allocation") Signed-off-by:Daniel Wagner <dwagner@suse.de> Signed-off-by:
Christoph Hellwig <hch@lst.de> Stable-dep-of: c94b7f9b ("nvme-hwmon: kmalloc the NVME SMART log buffer") Signed-off-by:
Sasha Levin <sashal@kernel.org>
parent
bc17f727
Please register or sign in to comment