From 7c93d397d18f5f5380a969f52a806c28b2c78d54 Mon Sep 17 00:00:00 2001 From: Li Xi Date: Fri, 26 Jul 2013 04:01:57 -0700 Subject: [PATCH] LU-3627 quota: Fix incorrect NULL return value of qsd_init() qsd_init() might return NULL in some cases, which is not correct and may make kernel crash. This patch fixes this problem. Signed-off-by: Li Xi Change-Id: I604077f2f9143e500badb5148a6f0d9a246e375f Reviewed-on: http://review.whamcloud.com/7100 Reviewed-by: Niu Yawei Tested-by: Hudson Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/quota/qsd_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/quota/qsd_lib.c b/lustre/quota/qsd_lib.c index dfbf8a2..2a665cc 100644 --- a/lustre/quota/qsd_lib.c +++ b/lustre/quota/qsd_lib.c @@ -535,7 +535,7 @@ struct qsd_instance *qsd_init(const struct lu_env *env, char *svname, /* only configure qsd for MDT & OST */ type = server_name2index(svname, &idx, NULL); if (type != LDD_F_SV_TYPE_MDT && type != LDD_F_SV_TYPE_OST) - RETURN(NULL); + RETURN(ERR_PTR(-EINVAL)); /* allocate qsd instance */ OBD_ALLOC_PTR(qsd); -- 1.8.3.1