[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.1002060944580.8092@ask.diku.dk>
Date: Sat, 6 Feb 2010 09:45:15 +0100 (CET)
From: Julia Lawall <julia@...u.dk>
To: Alex Elder <aelder@....com>, xfs-masters@....sgi.com,
xfs@....sgi.com, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH 11/11] fs/xfs: Correct NULL test
From: Julia Lawall <julia@...u.dk>
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@...u.dk>
---
fs/xfs/quota/xfs_qm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index 11cfd82..4318cd5 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists