Whamcloud - gitweb
LU-17104 build: Correct test for bad allocation 30/52330/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 11 Sep 2023 03:23:11 +0000 (22:23 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Sep 2023 06:03:51 +0000 (06:03 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I2ce197c31bf444d9f179942e516cfd9bdaf7dd9c
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52330
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/quota/qmt_entry.c

index cb3dca2..ba910c2 100644 (file)
@@ -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;
        }