• Julia Lawall's avatar
    In quickcam_messenger.c, if the NULL test on uvd is needed, then the · 0a2954e6
    Julia Lawall authored
    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.  If it could somehow be NULL, then
    the assignment should be moved after the NULL test.  Alternatively, perhaps
    the NULL test is intended to test std_info->stdid rather than std_info?
    
    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: default avatarJulia Lawall <julia@diku.dk>
    Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    0a2954e6
vpif_display.c 42.9 KB