mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-04 14:10:46 +00:00
watchdog: core: Fix devres_alloc() allocation size
Coverity reports:
Passing argument 152UL /* sizeof (*wdd) */ to function __devres_alloc_node
and then casting the return value to struct watchdog_device ** is
suspicious.
Allocation size needs to be sizeof(*rcwdd), not sizeof(*wdd).
Fixes: 83fbae5a14
("watchdog: Add a device managed API for ...")
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
parent
3be7988674
commit
2e91838bf7
@ -349,7 +349,7 @@ int devm_watchdog_register_device(struct device *dev,
|
||||
struct watchdog_device **rcwdd;
|
||||
int ret;
|
||||
|
||||
rcwdd = devres_alloc(devm_watchdog_unregister_device, sizeof(*wdd),
|
||||
rcwdd = devres_alloc(devm_watchdog_unregister_device, sizeof(*rcwdd),
|
||||
GFP_KERNEL);
|
||||
if (!rcwdd)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user