public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] I2C block read
@ 2006-06-07 17:33 Alexander Atanasov
  2006-06-07 17:49 ` Jean Delvare
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Atanasov @ 2006-06-07 17:33 UTC (permalink / raw)
  To: khali; +Cc: linux-kernel

	Hello,

	When doing i2c block read the lenght is passed as the first byte of the buffer,
so we must copy it from user otherwise temp is uninitialized.

Signed-off-by: Alexander Atanasov <alex@ssi.bg>

--
have fun,
alex


--- drivers/i2c/i2c-dev.c.orig	2006-01-04 02:00:00.000000000 +0200
+++ drivers/i2c/i2c-dev.c	2006-06-07 19:46:08.000000000 +0300
@@ -337,6 +337,7 @@
 
 		if ((data_arg.size == I2C_SMBUS_PROC_CALL) || 
 		    (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) || 
+		    (data_arg.size == I2C_SMBUS_BLOCK_DATA) ||
 		    (data_arg.read_write == I2C_SMBUS_WRITE)) {
 			if (copy_from_user(&temp, data_arg.data, datasize))
 				return -EFAULT;

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-06-12 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-07 17:33 [PATCH] I2C block read Alexander Atanasov
2006-06-07 17:49 ` Jean Delvare
2006-06-07 18:06   ` Alexander Atanasov
2006-06-07 18:50     ` Jean Delvare
2006-06-07 19:53       ` Jordan Crouse
2006-06-08 13:29       ` [PATCH] " Alexander Atanasov
2006-06-11 13:30         ` Jean Delvare
2006-06-12 14:16           ` Alexander Atanasov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox