Commit 2593cd11 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: synaptics-rmi4 - fix endianness issue in SMBus transport

The mapping table holds address in LE form, so we should convert it
to CPU when comparing it.
Reviewed-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 8cf0adf2
...@@ -89,17 +89,17 @@ static int rmi_smb_get_command_code(struct rmi_transport_dev *xport, ...@@ -89,17 +89,17 @@ static int rmi_smb_get_command_code(struct rmi_transport_dev *xport,
mutex_lock(&rmi_smb->mappingtable_mutex); mutex_lock(&rmi_smb->mappingtable_mutex);
for (i = 0; i < RMI_SMB2_MAP_SIZE; i++) { for (i = 0; i < RMI_SMB2_MAP_SIZE; i++) {
if (rmi_smb->mapping_table[i].rmiaddr == rmiaddr) { struct mapping_table_entry *entry = &rmi_smb->mapping_table[i];
if (le16_to_cpu(entry->rmiaddr) == rmiaddr) {
if (isread) { if (isread) {
if (rmi_smb->mapping_table[i].readcount if (entry->readcount == bytecount) {
== bytecount) {
*commandcode = i; *commandcode = i;
retval = 0; retval = 0;
goto exit; goto exit;
} }
} else { } else {
if (rmi_smb->mapping_table[i].flags & if (entry->flags & RMI_SMB2_MAP_FLAGS_WE) {
RMI_SMB2_MAP_FLAGS_WE) {
*commandcode = i; *commandcode = i;
retval = 0; retval = 0;
goto exit; goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment