Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d67b1b03 authored by Julia Lawall's avatar Julia Lawall Committed by Alex Elder
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 180040b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ xfs_Gqm_init(void)
		goto out;

	gdqhash = kmem_zalloc_large(hsize);
	if (!udqhash)
	if (!gdqhash)
		goto out_free_udqhash;

	hsize /= sizeof(xfs_dqhash_t);