aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/au0828
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-07-23 06:09:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 15:43:01 -0400
commitb5f5933a6ab63725aedfb92f015007d4ccd33a55 (patch)
tree35d4dea28c9d670c19537c3347cf954a926eceb5 /drivers/media/video/au0828
parent49b7a12c0aa217c9fb163d330b5b80bafe55cb8b (diff)
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 <error27@gmail.com> Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/au0828')
-rw-r--r--drivers/media/video/au0828/au0828-video.c4
1 files changed, 3 insertions, 1 deletions
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,
441 unsigned char *outp, unsigned long len) 441 unsigned char *outp, unsigned long len)
442{ 442{
443 unsigned char *startwrite, *startread; 443 unsigned char *startwrite, *startread;
444 int bytesperline = dev->vbi_width; 444 int bytesperline;
445 int i, j = 0; 445 int i, j = 0;
446 446
447 if (dev == NULL) { 447 if (dev == NULL) {
@@ -464,6 +464,8 @@ static void au0828_copy_vbi(struct au0828_dev *dev,
464 return; 464 return;
465 } 465 }
466 466
467 bytesperline = dev->vbi_width;
468
467 if (dma_q->pos + len > buf->vb.size) 469 if (dma_q->pos + len > buf->vb.size)
468 len = buf->vb.size - dma_q->pos; 470 len = buf->vb.size - dma_q->pos;
469 471