Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715845 > unrolled thread

[PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL

Started byJames Simmons <jsimmons@infradead.org>
First post2017-08-20 04:40 +0200
Last post2017-08-20 04:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL James Simmons <jsimmons@infradead.org> - 2017-08-20 04:40 +0200

#1715845 — [PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL

FromJames Simmons <jsimmons@infradead.org>
Date2017-08-20 04:40 +0200
Subject[PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL
Message-ID<ugojI-112-89@gated-at.bofh.it>
Check if lcfg passed in is NULL and if it is just return NULL.

Signed-off-by: James Simmons <uja.ornl@yahoo.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@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web