Skip to content

Commit

Permalink
V4L/DVB: au0828: move dereference below sanity checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Aug 2, 2010
1 parent 49b7a12 commit b5f5933
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;

Expand Down

0 comments on commit b5f5933

Please sign in to comment.