From 9db00d1dbdf33f63ff5eb8f122aafc924f5425ff Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Sun, 10 Sep 2023 22:23:11 -0500 Subject: [PATCH] LU-17104 build: Correct test for bad allocation Expect non-zero value following allocation. If zeroed reply to caller with -ENOMEM This patch fixes a build issue reported by gcc 12 Fixes: 09f9fb3211 ("LU-11023 quota: quota pools for OSTs") Signed-off-by: Shaun Tancheff Change-Id: I2ce197c31bf444d9f179942e516cfd9bdaf7dd9c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52330 Reviewed-by: Andreas Dilger Reviewed-by: Sergey Cheremencev Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/quota/qmt_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/quota/qmt_entry.c b/lustre/quota/qmt_entry.c index cb3dca2..ba910c2 100644 --- a/lustre/quota/qmt_entry.c +++ b/lustre/quota/qmt_entry.c @@ -1057,7 +1057,7 @@ int qti_lqes_restore_init(const struct lu_env *env) if (qti_lqes_inited(env) && qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) { OBD_ALLOC(qmt_info(env)->qti_lqes_rstr, qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore)); - if (!qti_lqes_rstr(env)) + if (!qmt_info(env)->qti_lqes_rstr) rc = -ENOMEM; } -- 1.8.3.1