From b5f5933a6ab63725aedfb92f015007d4ccd33a55 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 23 Jul 2010 07:09:20 -0300 Subject: [PATCH] V4L/DVB: au0828: move dereference below sanity checks This function has sanity checks to make sure that "dev" is non-null. I moved the dereference down below the checks. In the current code "dev" is never actually null. Signed-off-by: Dan Carpenter Acked-by: Devin Heitmueller Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/au0828/au0828-video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index d97e0a28fb24..7989a7ba7c40 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -441,7 +441,7 @@ static void au0828_copy_vbi(struct au0828_dev *dev, unsigned char *outp, unsigned long len) { unsigned char *startwrite, *startread; - int bytesperline = dev->vbi_width; + int bytesperline; int i, j = 0; if (dev == NULL) { @@ -464,6 +464,8 @@ static void au0828_copy_vbi(struct au0828_dev *dev, return; } + bytesperline = dev->vbi_width; + if (dma_q->pos + len > buf->vb.size) len = buf->vb.size - dma_q->pos; -- 2.30.2