Skip to content
Commit f96801f0 authored by Peng Fan's avatar Peng Fan Committed by Rafael J. Wysocki
Browse files

thermal/of: Fix potential uninitialized value access

If of_parse_phandle_with_args() called from __thermal_of_bind() or
__thermal_of_unbind() fails, cooling_spec.np will not be initialized,
so move the of_node_put() calls below the respective return value checks
to avoid dereferencing an uninitialized pointer.

Fixes: 3fd6d6e2

 ("thermal/of: Rework the thermal device tree initialization")
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b616959a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment