• Julia Lawall's avatar
    [ARM] pxa: avoid NULL dereferencing in error handling of ssp.c · 077de1ad
    Julia Lawall authored
    The assignments of res to the results of the two calls to
    platform_get_resource make it impossible to use res in the error handling
    code in the arguments to release_mem_region.
    
    The semantic match that finds the former problem is as follows:
    (http://coccinelle.lip6.fr/)
    
    // <smpl>
    @r exists@
    expression E, E1;
    identifier f;
    statement S1,S3;
    iterator iter;
    @@
    
    if ((E == NULL && ...) || ...)
    {
     ... when != false ((E == NULL && ...) || ...)
         when != true  ((E != NULL && ...) || ...)
         when != iter(E,...) S1
         when != E = E1
    (
     sizeof(E->f)
    |
    * E->f
    )
     ... when any
     return ...;
    }
    else S3
    // </smpl>
    Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
    Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
    077de1ad
ssp.c 4.9 KB