Possible off-by-one error in fscpos

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Stefan,

Coverity uncovered a possible off-by-one error in your Linux 2.6 fscpos
driver, in function set_temp_reset. I believe it is correct, and the fix
is probably as simple as:

 drivers/hwmon/fscpos.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.13-rc7.orig/drivers/hwmon/fscpos.c	2005-08-24 21:37:02.000000000 +0200
+++ linux-2.6.13-rc7/drivers/hwmon/fscpos.c	2005-08-25 13:23:13.000000000 +0200
@@ -168,7 +168,7 @@
 				"experience to the module author.\n");
 
 	/* Supported value: 2 (clears the status) */
-	fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr], 2);
+	fscpos_write_value(client, FSCPOS_REG_TEMP_STATE[nr - 1], 2);
 	return count;
 }
 

Can you please comment on this, confirm the problem and solution, and
test the patch?

Thanks,
-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux