1*c342db35SBrad BishopFrom e0b2be7a1fce0fed63bac8c350b711b69edfe30e Mon Sep 17 00:00:00 2001 2*c342db35SBrad BishopFrom: "yanjun.zhu" <yanjun.zhu@windriver.com> 3*c342db35SBrad BishopDate: Tue, 30 Apr 2019 10:04:58 +0800 4*c342db35SBrad BishopSubject: [PATCH] openhpid/safhpi.c: fix function saHpiSensorThresholdsSet 5*c342db35SBrad Bishop 6*c342db35SBrad BishopIn COPY_TH the SensorThresholds->TH will be copied to tmp.TH only if 7*c342db35SBrad BishopTH.IsSupported == SAHPI_TRUE. So we should pass &tmp but not 8*c342db35SBrad BishopSensorThresholds as the argument to OH_CALL_ABI. Otherwise the TH will 9*c342db35SBrad Bishopbe set even if TH.IsSupported == SAHPI_FALSE. 10*c342db35SBrad Bishop 11*c342db35SBrad BishopUpstream-Status: Submitted 12*c342db35SBrad Bishop[https://github.com/open-hpi/openhpi/pull/2744/commits/77a78bb1ada56e55c5ba6d7a5987c214705bf035] 13*c342db35SBrad Bishop 14*c342db35SBrad BishopSigned-off-by: yanjun.zhu <yanjun.zhu@windriver.com> 15*c342db35SBrad BishopSigned-off-by: Yi Zhao <yi.zhao@windriver.com> 16*c342db35SBrad Bishop--- 17*c342db35SBrad Bishop openhpid/safhpi.c | 2 +- 18*c342db35SBrad Bishop 1 file changed, 1 insertion(+), 1 deletion(-) 19*c342db35SBrad Bishop 20*c342db35SBrad Bishopdiff --git a/openhpid/safhpi.c b/openhpid/safhpi.c 21*c342db35SBrad Bishopindex 28a2632..61b7f03 100644 22*c342db35SBrad Bishop--- a/openhpid/safhpi.c 23*c342db35SBrad Bishop+++ b/openhpid/safhpi.c 24*c342db35SBrad Bishop@@ -1933,7 +1933,7 @@ SaErrorT SAHPI_API saHpiSensorThresholdsSet ( 25*c342db35SBrad Bishop oh_release_domain(d); /* Unlock domain */ 26*c342db35SBrad Bishop 27*c342db35SBrad Bishop OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv, 28*c342db35SBrad Bishop- ResourceId, SensorNum, SensorThresholds); 29*c342db35SBrad Bishop+ ResourceId, SensorNum, &tmp); 30*c342db35SBrad Bishop oh_release_handler(h); 31*c342db35SBrad Bishop 32*c342db35SBrad Bishop return rv; 33*c342db35SBrad Bishop-- 34*c342db35SBrad Bishop2.7.4 35*c342db35SBrad Bishop 36