hwmon: (axi-fan-control) Fix possible NULL pointer dereference
authorDragos Bogdan <dragos.bogdan@analog.com>
Wed, 25 Oct 2023 13:21:00 +0000 (15:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:07 +0000 (11:59 +0100)
commitc49f14cc1bb12c625a1c572e8a95b6adefd4d8eb
treecb39ecacdc47a71aca90a2e9bf365f99883b56d1
parentd51b96c90d5dcbd64803180e28f601ae4002a989
hwmon: (axi-fan-control) Fix possible NULL pointer dereference

[ Upstream commit 2a5b3370a1d9750eca325292e291c8c7cb8cf2e0 ]

axi_fan_control_irq_handler(), dependent on the private
axi_fan_control_data structure, might be called before the hwmon
device is registered. That will cause an "Unable to handle kernel
NULL pointer dereference" error.

Fixes: 8412b410fa5e ("hwmon: Support ADI Fan Control IP")
Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Signed-off-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231025132100.649499-1-nuno.sa@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/axi-fan-control.c