]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: dst: correct error-handling code
authorJulia Lawall <julia@diku.dk>
Tue, 28 Jul 2009 15:52:56 +0000 (17:52 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:02:06 +0000 (12:02 -0700)
commitac3442d7e3f4351bc6ac6a7944ebe5bda110c07d
tree86faef7d4382cfd639c7fa886bab435f0eea22f1
parentf05fc7ff5e744eae49d640481d4d0bcb574f46fe
Staging: dst: correct error-handling code

dst_state_alloc returns an ERR_PTR value in an error case instead of NULL.

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

// <smpl>
@match exists@
expression x, E;
statement S1, S2;
@@

x = dst_state_alloc(...)
... when != x = E
(
*  if (x == NULL || ...) S1 else S2
|
*  if (x == NULL && ...) S1 else S2
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/dst/export.c