From 8789d45536081ab667865ccc14b10628c7fadbf3 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Tue, 22 Aug 2017 17:13:38 -0400 Subject: [PATCH] LU-8066 libcfs: call kernel_param_unlock on error In libcfs_param_debug_mb_set, kerenl_param_unlock should be called in case of an error. Change-Id: Iafeeb21b2d891f4ed7432e4d1ddd3c383fe33d5a Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/28612 Tested-by: Jenkins Reviewed-by: Bob Glossman Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- libcfs/libcfs/debug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index 02af6fa..999eec4 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -73,6 +73,10 @@ static int libcfs_param_debug_mb_set(const char *val, #endif if (!*((unsigned int *)kp->arg)) { *((unsigned int *)kp->arg) = num; + +#if !defined(HAVE_MODULE_PARAM_LOCKING) && !defined(HAVE_KERNEL_PARAM_LOCK) + kernel_param_unlock(THIS_MODULE); +#endif return 0; } -- 1.8.3.1