linux/drivers/media/video/usbvideo
Julia Lawall 728385c4d3 V4L/DVB: drivers/media/video: move dereference after NULL test
In quickcam_messenger.c, if the NULL test on uvd is needed, then the
dereference should be after the NULL test.

In vpif_display.c, std_info is initialized to the address of a structure
field.  This seems unlikely to be NULL.  Test std_info->stdid instead.

In saa7134-alsa.c, the function is only called from one place, where the
chip argument has already been dereferenced.  On the other hand, if it
should be kept, then card should be initialized after it.

A simplified version of the semantic match that detects this problem is as
follows (http://coccinelle.lip6.fr/):

// <smpl>
@match exists@
expression x, E;
identifier fld;
@@

* x->fld
  ... when != \(x = E\|&x\)
* x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Muralidharan Karicheri <m-karicheri2@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-05-18 00:47:16 -03:00
..
Kconfig
Makefile
ibmcam.c
konicawc.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
quickcam_messenger.c V4L/DVB: drivers/media/video: move dereference after NULL test 2010-05-18 00:47:16 -03:00
quickcam_messenger.h
ultracam.c
usbvideo.c V4L/DVB (13550): v4l: Use the new video_device_node_name function 2009-12-16 00:17:55 -02:00
usbvideo.h
vicam.c V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignments 2009-12-16 00:17:57 -02:00