diff --git a/drivers/media/usb/dvb-usb/technisat-usb2.c b/drivers/media/usb/dvb-usb/technisat-usb2.c index c659e18b358b..877465d11f69 100644 --- a/drivers/media/usb/dvb-usb/technisat-usb2.c +++ b/drivers/media/usb/dvb-usb/technisat-usb2.c @@ -612,6 +612,7 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d) u8 *b; int ret; struct ir_raw_event ev; + int i = ARRAY_SIZE(state->buf) - 1; buf[0] = GET_IR_DATA_VENDOR_REQUEST; buf[1] = 0x08; @@ -655,7 +656,7 @@ static int technisat_usb2_get_ir(struct dvb_usb_device *d) #endif ev.pulse = 0; - while (1) { + while (b != (buf + i)) { ev.pulse = !ev.pulse; ev.duration = (*b * FIRMWARE_CLOCK_DIVISOR * FIRMWARE_CLOCK_TICK) / 1000; ir_raw_event_store(d->rc_dev, &ev);