Skip to content
Commit e027a2de authored by Wenwen Wang's avatar Wenwen Wang Committed by Guenter Roeck
Browse files

hwmon (coretemp) Fix a memory leak bug



In coretemp_init(), 'zone_devices' is allocated through kcalloc().
However, it is not deallocated in the following execution if
platform_driver_register() fails, leading to a memory leak. To fix this
issue, introduce the 'outzone' label to free 'zone_devices' before
returning the error.

Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
Link: https://lore.kernel.org/r/1566248402-6538-1-git-send-email-wenwen@cs.uga.edu


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 7d82fcc9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment