Whamcloud - gitweb
LU-8066 libcfs: call kernel_param_unlock on error 12/28612/3
authorHongchao Zhang <hongchao.zhang@intel.com>
Tue, 22 Aug 2017 21:13:38 +0000 (17:13 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 31 Aug 2017 19:17:03 +0000 (19:17 +0000)
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 <hongchao.zhang@intel.com>
Reviewed-on: https://review.whamcloud.com/28612
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/libcfs/debug.c

index 02af6fa..999eec4 100644 (file)
@@ -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;
        }