Skip to content
Commit cf05b824 authored by Julia Lawall's avatar Julia Lawall Committed by Martin Schwidefsky
Browse files

[S390] drivers/s390: put NULL test before dereference



If the NULL test on block is needed, it should be before the dereference of
the base field.

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

// <smpl>
@r@
expression E1,E2;
identifier fld;
statement S1,S2;
@@

E1 = E2->fld;
(
if (E1 == NULL) S1 else S2
|
*if (E2 == NULL) S1 else S2
)
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 06739a8a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment