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

Skip to content
Commit b5170978 authored by Julia Lawall's avatar Julia Lawall Committed by David Woodhouse
Browse files

mtd: spear_smi: failure test for null rather than negative integer

dev_get_platdata returns a pointer, so the failure value would be NULL
rather than a negative integer.

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

)

// <smpl>
@@
expression x,e;
statement S1,S2;
@@

*x = dev_get_platdata(...)
... when != x = e
*if (x < 0) S1 else S2
// </smpl>

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Acked-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 9c6f62a7
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