ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test
authorJulia Lawall <julia@diku.dk>
Sat, 17 Oct 2009 06:42:49 +0000 (08:42 +0200)
committerBen Dooks <ben-linux@fluff.org>
Wed, 28 Oct 2009 18:25:57 +0000 (18:25 +0000)
commit60e5c1b5ecd99e06d3133a2a20d58d3c2b9968ac
tree84a2faad185d03646999895ed4d074c7ada03fd7
parentd3bf3956c75b38def079fb6db40b5cf3f1466a93
ARM: S3C24XX: arch/arm/plat-s3c24xx: Move dereference after NULL test

If the NULL test on buf is needed, then the dereference should be after the
NULL test.

A simplified version of the semantic match that detects this problem is as
follows (http://coccinelle.lip6.fr/):

// <smpl>
@match exists@
expression x, E;
identifier fld;
@@

* x->fld
  ... when != \(x = E\|&x\)
* x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
arch/arm/plat-s3c24xx/dma.c