fs/xfs: Correct NULL test
authorJulia Lawall <julia@diku.dk>
Sat, 6 Feb 2010 08:45:15 +0000 (08:45 +0000)
committerAlex Elder <aelder@sgi.com>
Sat, 13 Feb 2010 19:22:53 +0000 (13:22 -0600)
commitd67b1b03254c501fef371b0e5916c94a52bfc2c5
tree87d3505cb841844055c113fd9eea124ed31e2ba0
parent180040b89ee2aed88c0a0b1fcf7ada9a512b12e3
fs/xfs: Correct NULL test

Test the value that was just allocated rather than the previously tested one.

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

// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@

if (x == NULL || ...) {
    ... when forall
    return ...; }
... when != goto l;
    when != x = e
    when != &x
*x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
fs/xfs/quota/xfs_qm.c