Emmanuel Grumbach <[email protected]> writes:

> From: Chaya Rachel Ivgi <[email protected]>
>
> Register to thermal_zone interface and implement the
> thermal ops.

And there it was :)


> +static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm)
> +{
> +     int i;
> +     char name[] = "iwlwifi";
> +
> +     if (!iwl_mvm_is_tt_in_fw(mvm)) {
> +             mvm->tz_device.tzone = NULL;
> +
> +             return;
> +     }
> +
> +     BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
> +
> +     mvm->tz_device.tzone = thermal_zone_device_register(name,


Why not simply 
        mvm->tz_device.tzone = thermal_zone_device_register(DRV_NAME,
?




> +                                                     IWL_MAX_DTS_TRIPS,
> +                                                     IWL_WRITABLE_TRIPS_MSK,
> +                                                     mvm, &tzone_ops,
> +                                                     NULL, 0, 0);
> +     if (IS_ERR(mvm->tz_device.tzone)) {
> +             IWL_DEBUG_TEMP(mvm,
> +                            "Failed to register to thermal zone (err = 
> %ld)\n",
> +                            PTR_ERR(mvm->tz_device.tzone));
> +             return;
> +     }

So you return with an ERR_PTR in mvm->tz_device.tzone?


> +static void iwl_mvm_thermal_zone_unregister(struct iwl_mvm *mvm)
> +{
> +     if (!iwl_mvm_is_tt_in_fw(mvm))
> +             return;
> +
> +     if (mvm->tz_device.tzone) {
> +             IWL_DEBUG_TEMP(mvm, "Thermal zone device unregister\n");
> +             thermal_zone_device_unregister(mvm->tz_device.tzone);

Won't that ERR_PTR blow up when dereferenced by
thermal_zone_device_unregister() ?



Bjørn
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to