• Julia Lawall's avatar
    [media] drivers/media/video: add missing kfree · ee893e9a
    Julia Lawall authored
    Free the recently allocated qcam in each case.
    
    The semantic match that finds this problem is as follows:
    
    // <smpl>
    @r@
    identifier x;
    @@
    
    kfree(x)
    
    @@
    identifier r.x;
    expression E1!=0,E2,E3,E4;
    statement S;
    @@
    
    (
    if (<+...x...+>) S
    |
    if (...) { ... when != kfree(x)
                   when != if (...) { ... kfree(x); ... }
                   when != x = E3
    * return E1;
    }
    ... when != x = E2
    if (...) { ... when != x = E4
     kfree(x); ... return ...; }
    )
    // </smpl>
    Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    ee893e9a
bw-qcam.c 26.8 KB