watchdog: menz069_wdt: fix watchdog initialisation
authorJohannes Thumshirn <jth@kernel.org>
Tue, 18 Apr 2023 17:25:30 +0000 (19:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:07 +0000 (10:34 +0200)
commit867dae55478093824e2ba55ab0f2f5ca4c8a29ba
tree424a70c722d9b125b846413bf5806aa48f18b141
parent787e74b21394f126bbce355839dcce9b0ad256d2
watchdog: menz069_wdt: fix watchdog initialisation

[ Upstream commit 87b22656ca6a896d0378e9e60ffccb0c82f48b08 ]

Doing a 'cat /dev/watchdog0' with menz069_wdt as watchdog0 will result in
a NULL pointer dereference.

This happens because we're passing the wrong pointer to
watchdog_register_device(). Fix this by getting rid of the static
watchdog_device structure and use the one embedded into the driver's
per-instance private data.

Signed-off-by: Johannes Thumshirn <jth@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230418172531.177349-2-jth@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/watchdog/menz69_wdt.c