]> git.baikalelectronics.ru Git - kernel.git/commit
[S390] drivers/s390: put NULL test before dereference
authorJulia Lawall <julia@diku.dk>
Sun, 23 Aug 2009 16:09:05 +0000 (18:09 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Sun, 23 Aug 2009 16:10:00 +0000 (18:10 +0200)
commitbe75b8fcc01632a88ea3a380fc2ef4346e05a49d
tree0fa55852038849722150149da4ab418f96c945b3
parent8b838c7f431b41ab51a3056c62bb365e3af970be
[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: Julia Lawall <julia@diku.dk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c