aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-01-07 19:08:19 -0500
committerJiri Kosina <jkosina@suse.cz>2011-01-07 19:08:19 -0500
commita7153258b70ccbe3922fcee9ca4271d4f4c2bc55 (patch)
tree12e17027af36846933908da64a1419491ea58676 /drivers/hid/hid-picolcd.c
parentae5e49c79c051ea1d5ca91cbd4a0d22189067ba3 (diff)
parent0fbf8ed976af5bb43cf9cf2492161eb9688fee0c (diff)
Merge branches 'upstream' and 'upstream-fixes' into for-linus
Diffstat (limited to 'drivers/hid/hid-picolcd.c')
-rw-r--r--drivers/hid/hid-picolcd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index ed0e066b7f07..de9cf21b3494 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -1544,7 +1544,7 @@ static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u,
1544 1544
1545 /* prepare buffer with info about what we want to read (addr & len) */ 1545 /* prepare buffer with info about what we want to read (addr & len) */
1546 raw_data[0] = *off & 0xff; 1546 raw_data[0] = *off & 0xff;
1547 raw_data[1] = (*off >> 8) && 0xff; 1547 raw_data[1] = (*off >> 8) & 0xff;
1548 raw_data[2] = s < 20 ? s : 20; 1548 raw_data[2] = s < 20 ? s : 20;
1549 if (*off + raw_data[2] > 0xff) 1549 if (*off + raw_data[2] > 0xff)
1550 raw_data[2] = 0x100 - *off; 1550 raw_data[2] = 0x100 - *off;
@@ -1583,7 +1583,7 @@ static ssize_t picolcd_debug_eeprom_write(struct file *f, const char __user *u,
1583 1583
1584 memset(raw_data, 0, sizeof(raw_data)); 1584 memset(raw_data, 0, sizeof(raw_data));
1585 raw_data[0] = *off & 0xff; 1585 raw_data[0] = *off & 0xff;
1586 raw_data[1] = (*off >> 8) && 0xff; 1586 raw_data[1] = (*off >> 8) & 0xff;
1587 raw_data[2] = s < 20 ? s : 20; 1587 raw_data[2] = s < 20 ? s : 20;
1588 if (*off + raw_data[2] > 0xff) 1588 if (*off + raw_data[2] > 0xff)
1589 raw_data[2] = 0x100 - *off; 1589 raw_data[2] = 0x100 - *off;
@@ -1867,6 +1867,7 @@ static void picolcd_debug_out_report(struct picolcd_data *data,
1867 report->id, raw_size); 1867 report->id, raw_size);
1868 hid_debug_event(hdev, buff); 1868 hid_debug_event(hdev, buff);
1869 if (raw_size + 5 > sizeof(raw_data)) { 1869 if (raw_size + 5 > sizeof(raw_data)) {
1870 kfree(buff);
1870 hid_debug_event(hdev, " TOO BIG\n"); 1871 hid_debug_event(hdev, " TOO BIG\n");
1871 return; 1872 return;
1872 } else { 1873 } else {