]> git.baikalelectronics.ru Git - kernel.git/commit
powercap/drivers/dtpm: Fix size of object being allocated
authorColin Ian King <colin.king@canonical.com>
Mon, 4 Jan 2021 12:10:53 +0000 (12:10 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Jan 2021 17:16:03 +0000 (18:16 +0100)
commit0f1c29302ffade03c1c4a3e40c89f02ae8a34a00
tree8a78fb8439a51663eadee79912d9e94bb6ef7bc8
parente1052f2566c8b25aaf50f4abc06e5852199df429
powercap/drivers/dtpm: Fix size of object being allocated

The kzalloc allocation for dtpm_cpu is currently allocating the size
of the pointer and not the size of the structure. Fix this by using
the correct sizeof argument.

Addresses-Coverity: ("Wrong sizeof argument")
Fixes: 5902ac232f4b ("powercap/drivers/dtpm: Add CPU energy model based support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/dtpm_cpu.c