You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
soc: rockchip_system_monitor: fix potential NULL ptr deref
Signed-off-by: jensen <jensenhuang@friendlyarm.com>
This commit is contained in:
@@ -1186,6 +1186,11 @@ rockchip_system_monitor_wide_temp_init(struct monitor_dev_info *info)
|
||||
info->is_low_temp = true;
|
||||
}
|
||||
|
||||
if (!system_monitor->tz) {
|
||||
dev_err(info->dev, "thermal zone is NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ret = thermal_zone_get_temp(system_monitor->tz, &temp);
|
||||
if (ret || temp == THERMAL_TEMP_INVALID) {
|
||||
dev_err(info->dev,
|
||||
@@ -1373,6 +1378,11 @@ rockchip_system_monitor_register(struct device *dev,
|
||||
if (!devp)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (!devp->check_rate_volt) {
|
||||
dev_warn(dev, "using default check_rate_volt\n");
|
||||
devp->check_rate_volt = rockchip_monitor_check_rate_volt;
|
||||
}
|
||||
|
||||
info = kzalloc(sizeof(*info), GFP_KERNEL);
|
||||
if (!info)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user