All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write
@ 2015-07-10  5:07 Ellen Wang
  2015-07-13 11:20 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Ellen Wang @ 2015-07-10  5:07 UTC (permalink / raw)
  To: borneo.antonio-Re5JQEeQqe8AvxtiuMwx3w,
	dbarksdale-2SNLKkHU5xRBDgjK7y7TUQ, jkosina-AlSwsSmVLrQ,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR

When doing an I2C_SMBUS_BYTE write (one byte write, no address),
the data to be written is in "command" not "data->byte".
---
 drivers/hid/hid-cp2112.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index a3703b8..7afc3fc 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -606,7 +606,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		if (I2C_SMBUS_READ == read_write)
 			count = cp2112_read_req(buf, addr, read_length);
 		else
-			count = cp2112_write_req(buf, addr, data->byte, NULL,
+			count = cp2112_write_req(buf, addr, command, NULL,
 						 0);
 		break;
 	case I2C_SMBUS_BYTE_DATA:
-- 
1.9.1

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

* Re: [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write
  2015-07-10  5:07 [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write Ellen Wang
@ 2015-07-13 11:20 ` Jiri Kosina
       [not found]   ` <alpine.LNX.2.00.1507131320060.7522-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2015-07-13 11:20 UTC (permalink / raw)
  To: Ellen Wang; +Cc: borneo.antonio, dbarksdale, linux-input, linux-i2c

On Thu, 9 Jul 2015, Ellen Wang wrote:

> When doing an I2C_SMBUS_BYTE write (one byte write, no address),
> the data to be written is in "command" not "data->byte".

This is missing Signoff.

How serious is this bug in practice? Is this 4.2 material?

Thanks,

-- 
Jiri Kosina
SUSE Labs

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

* Re: [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write
       [not found]   ` <alpine.LNX.2.00.1507131320060.7522-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
@ 2015-07-13 22:28     ` Ellen Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Ellen Wang @ 2015-07-13 22:28 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: borneo.antonio-Re5JQEeQqe8AvxtiuMwx3w,
	dbarksdale-2SNLKkHU5xRBDgjK7y7TUQ,
	linux-input-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On 7/13/2015 4:20 AM, Jiri Kosina wrote:
> On Thu, 9 Jul 2015, Ellen Wang wrote:
>
>> When doing an I2C_SMBUS_BYTE write (one byte write, no address),
>> the data to be written is in "command" not "data->byte".
>
> This is missing Signoff.

Sorry.  I submitted v2.

> How serious is this bug in practice? Is this 4.2 material?

The driver segfaults without the fix, and this is a common operation. 
On the other hand, the cp2112 is an uncommon device.

(I would personally like all the cp2112 fixes to be in 4.1 eventually. 
They are all important functional improvements.)

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

end of thread, other threads:[~2015-07-13 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10  5:07 [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write Ellen Wang
2015-07-13 11:20 ` Jiri Kosina
     [not found]   ` <alpine.LNX.2.00.1507131320060.7522-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2015-07-13 22:28     ` Ellen Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.