Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cb6ec182 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Tomi Valkeinen
Browse files

drivers/video/fbdev : dereference without an error test



After a variable is assigned the result of backlight_device_register, an
error test should be performed before a dereference.

A simplified version of the semantic match that finds this problem is
as follows:

// <smpl>
@def0@
expression x;
position p0;
@@

x@p0 = backlight_device_register(...)

@protected@
expression def0.x,E;
position def0.p0;
position p;
statement S;
@@
x@p0
... when != x = E
if (!IS_ERR(x) && ...) {<... x@p ...>} else S

@unprotected@
expression def0.x,E;
identifier fld;
position def0.p0;
position p != protected.p;
@@
x@p0
... when != x = E
* x@p->fld
// </smpl>

Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent a497c3ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment