watchdog: core: Fix devres_alloc() allocation size
authorGuenter Roeck <linux@roeck-us.net>
Wed, 10 Aug 2016 05:34:31 +0000 (22:34 -0700)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 23 Sep 2016 06:37:14 +0000 (08:37 +0200)
commit2e91838bf7ffdedabdb29e091207d6531d04ef4f
tree867ed2a750e4658e9c2864a6d8c0ea65ca1ba88f
parent3be7988674ab33565700a37b210f502563d932e6
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: 83fbae5a148c ("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>
drivers/watchdog/watchdog_core.c