aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/IR/mceusb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 18110987597e..ed151c8290fe 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -446,7 +446,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf,
446 return; 446 return;
447 447
448 /* skip meaningless 0xb1 0x60 header bytes on orig receiver */ 448 /* skip meaningless 0xb1 0x60 header bytes on orig receiver */
449 if (ir->flags.microsoft_gen1 && !out) 449 if (ir->flags.microsoft_gen1 && !out && !offset)
450 skip = 2; 450 skip = 2;
451 451
452 if (len <= skip) 452 if (len <= skip)
@@ -807,6 +807,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
807 if (ir->flags.microsoft_gen1) 807 if (ir->flags.microsoft_gen1)
808 i = 2; 808 i = 2;
809 809
810 /* if there's no data, just return now */
811 if (buf_len <= i)
812 return;
813
810 for (; i < buf_len; i++) { 814 for (; i < buf_len; i++) {
811 switch (ir->parser_state) { 815 switch (ir->parser_state) {
812 case SUBCMD: 816 case SUBCMD: