]> bbs.cooldavid.org Git - net-next-2.6.git/commit
V4L/DVB: saa7164: move dereference under NULL check
authorDan Carpenter <error27@gmail.com>
Thu, 19 Aug 2010 10:00:22 +0000 (07:00 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 28 Sep 2010 01:21:49 +0000 (22:21 -0300)
commit23e64d55859ea619c17832645e0e56faac84d750
tree38ee583149639e23e8d5dd43ff6f6f4d616ff85d
parentd5337966ce4639c775ff5edf92d78f5fad34ef0d
V4L/DVB: saa7164: move dereference under NULL check

The original code dereferenced "port" before checking it for NULL.  I
moved the test down below the check.  Also I changed the comparisons a
little so people wouldn't get confused and think "port" and "buf" were
ints instead of pointers.  (Probably that's what lead to this issue in
the first place.)

There is only one caller for this function and it passes non-NULL
pointers, so this is essentially a cleanup rather than a bugfix.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7164/saa7164-buffer.c