[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1503196018-24500-29-git-send-email-jsimmons@infradead.org>
Date: Sat, 19 Aug 2017 22:26:22 -0400
From: James Simmons <jsimmons@...radead.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
devel@...verdev.osuosl.org,
Andreas Dilger <andreas.dilger@...el.com>,
Oleg Drokin <oleg.drokin@...el.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Lustre Development List <lustre-devel@...ts.lustre.org>,
James Simmons <jsimmons@...radead.org>,
James Simmons <uja.ornl@...oo.com>
Subject: [PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL
Check if lcfg passed in is NULL and if it is just return NULL.
Signed-off-by: James Simmons <uja.ornl@...oo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: https://review.whamcloud.com/22138
Reviewed-by: Dmitry Eremin <dmitry.eremin@...el.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@...el.com>
Reviewed-by: Fan Yong <fan.yong@...el.com>
Reviewed-by: Oleg Drokin <oleg.drokin@...el.com>
Signed-off-by: James Simmons <jsimmons@...radead.org>
---
drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
index 4d23938..4208d61 100644
--- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
@@ -161,6 +161,9 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index)
size_t offset;
__u32 bufcount;
+ if (!lcfg)
+ return NULL;
+
bufcount = lcfg->lcfg_bufcount;
if (index >= bufcount)
return NULL;
--
1.8.3.1
Powered by blists - more mailing lists