OSDN Git Service

thermal/core: Remove unneeded ida_destroy()
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 23 Jan 2023 15:27:55 +0000 (16:27 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 25 Jan 2023 15:40:39 +0000 (16:40 +0100)
As per documentation for the ida_destroy() function: "If the IDA is
already empty, there is no need to call this function."

The thermal framework is in the init sequence, so the ida was not yet
used and consequently it is empty in case of error.

There is no need to call ida_destroy(), let's remove the calls.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c

index e79ea01..99869e9 100644 (file)
@@ -1625,8 +1625,6 @@ unregister_governors:
 unregister_netlink:
        thermal_netlink_exit();
 error:
-       ida_destroy(&thermal_tz_ida);
-       ida_destroy(&thermal_cdev_ida);
        mutex_destroy(&thermal_list_lock);
        mutex_destroy(&thermal_governor_lock);
        return result;