linux/drivers/s390/crypto
Julia Lawall 21e7b2c4d5 [S390] drivers/s390/crypto: Move dereference to after IS_ERR test
If reply is ERR_PTR(...), then it should not be dereferenced, so I have
moved the dereference from the declaration to after the IS_ERR test.

The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

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

(
x = E;
|
x = E
|
x@p1->fld
... when != x = E
IS_ERR(x@p2)
... when any
)

@other_match exists@
expression match.x, E1, E2;
position match.p1,match.p2;
@@

x = E1
... when != x = E2
    when != x@p1
x@p2

@ script:python depends on !other_match@
p1 << match.p1;
p2 << match.p2;
@@

print "* file %s dereference %s test %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25 13:39:16 +01:00
..
ap_bus.c [S390] ap: Minor code beautification. 2008-12-25 13:38:57 +01:00
ap_bus.h [S390] zcrypt: Use of Thin Interrupts 2008-12-25 13:38:57 +01:00
Makefile [S390] zcrypt driver Makefile, Kconfig and monolithic build. 2006-09-20 15:58:34 +02:00
zcrypt_api.c Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2008-07-14 14:48:31 -07:00
zcrypt_api.h [S390] Cleanup zcrypt printk messages. 2008-07-14 10:02:19 +02:00
zcrypt_cca_key.h [S390] zcrypt: Comments and kernel-doc cleanup 2008-04-17 07:47:06 +02:00
zcrypt_cex2a.c [S390] drivers/s390/crypto: Move dereference to after IS_ERR test 2008-12-25 13:39:16 +01:00
zcrypt_cex2a.h [S390] zcrypt secure key cryptography extension. 2006-09-20 15:58:36 +02:00
zcrypt_error.h [S390] Cleanup zcrypt printk messages. 2008-07-14 10:02:19 +02:00
zcrypt_mono.c [S390] zcrypt: make init/exit functions static. 2007-10-12 16:13:03 +02:00
zcrypt_pcica.c [S390] drivers/s390/crypto: Move dereference to after IS_ERR test 2008-12-25 13:39:16 +01:00
zcrypt_pcica.h [S390] zcrypt secure key cryptography extension. 2006-09-20 15:58:36 +02:00
zcrypt_pcicc.c [S390] drivers/s390/crypto: Move dereference to after IS_ERR test 2008-12-25 13:39:16 +01:00
zcrypt_pcicc.h [S390] zcrypt secure key cryptography extension. 2006-09-20 15:58:36 +02:00
zcrypt_pcixcc.c [S390] drivers/s390/crypto: Move dereference to after IS_ERR test 2008-12-25 13:39:16 +01:00
zcrypt_pcixcc.h [S390] zcrypt: remove duplicated struct CPRBX definition 2007-10-12 16:13:04 +02:00