diff mbox series

thermal: ti-soc-thermal: Fix reversed condition in ti_thermal_expose_sensor()

Message ID 20200616091949.GA11940@mwanda (mailing list archive)
State New, archived
Headers show
Series thermal: ti-soc-thermal: Fix reversed condition in ti_thermal_expose_sensor() | expand

Commit Message

Dan Carpenter June 16, 2020, 9:19 a.m. UTC
This condition is reversed and will cause breakage.

Fixes: 7440f518dad9 ("thermal/drivers/ti-soc-thermal: Avoid dereferencing ERR_PTR")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano July 21, 2020, 1:13 p.m. UTC | #1
On 16/06/2020 11:19, Dan Carpenter wrote:
> This condition is reversed and will cause breakage.
> 
> Fixes: 7440f518dad9 ("thermal/drivers/ti-soc-thermal: Avoid dereferencing ERR_PTR")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
 Applied.
diff mbox series

Patch

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 85776db4bf34..2ce4b19f312a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -169,7 +169,7 @@  int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 
 	data = ti_bandgap_get_sensor_data(bgp, id);
 
-	if (!IS_ERR_OR_NULL(data))
+	if (IS_ERR_OR_NULL(data))
 		data = ti_thermal_build_data(bgp, id);
 
 	if (!data)