From: Hongchao Zhang Date: Tue, 22 Aug 2017 21:13:38 +0000 (-0400) Subject: LU-8066 libcfs: call kernel_param_unlock on error X-Git-Tag: 2.10.53~30 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=8789d45536081ab667865ccc14b10628c7fadbf3;p=fs%2Flustre-release.git 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 --- 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; }