Skip to content

Commit

Permalink
thermal: int3403: Delete a check before thermal_zone_device_unregister()
Browse files Browse the repository at this point in the history
The thermal_zone_device_unregister() function tests whether its argument
is NULL and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Markus Elfring authored and Zhang Rui committed Dec 9, 2014
1 parent 19ecaea commit 931b9c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/thermal/int340x_thermal/int3403_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ static int int3403_sensor_add(struct int3403_priv *priv)
return 0;

err_free_obj:
if (obj->tzone)
thermal_zone_device_unregister(obj->tzone);
thermal_zone_device_unregister(obj->tzone);
return result;
}

Expand Down

0 comments on commit 931b9c8

Please sign in to comment.