diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index 023ff9ebde5e..4f1291cd4bbc 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -1397,7 +1397,6 @@ static void tw5864_handle_frame(struct tw5864_h264_frame *frame) return; } - v4l2_buf = to_vb2_v4l2_buffer(&vb->vb.vb2_buf); /* * Check for space. @@ -1410,6 +1409,8 @@ static void tw5864_handle_frame(struct tw5864_h264_frame *frame) return; } + v4l2_buf = to_vb2_v4l2_buffer(&vb->vb.vb2_buf); + for (i = 0; i < 8 - input->tail_nb_bits; i++) vlc_mask |= 1 << i; tail_mask = (~vlc_mask) & 0xff;