02 Jun, 2011

1 commit


25 Jan, 2011

1 commit

  • lcd_device_register may return ERR_PTR, so a check is added for this value
    before the dereference. All of the other changes reorganize the error
    handling code in this function to avoid duplicating all of it in the added
    case.

    In the original code, in one case, the global variable fb_buffer was set to
    NULL in error code that appears after this variable is initialized. This
    is done now in all error handling code that has this property.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @r@
    identifier f;
    @@
    f(...) { ... return ERR_PTR(...); }

    @@
    identifier r.f, fld;
    expression x;
    statement S1,S2;
    @@
    x = f(...)
    ... when != IS_ERR(x)
    (
    if (IS_ERR(x) ||...) S1 else S2
    |
    *x->fld
    )
    //

    Signed-off-by: Julia Lawall
    Acked-by: Mike Frysinger
    Signed-off-by: Paul Mundt

    Julia Lawall
     

26 Nov, 2010

1 commit