From a309a526f061e4e4d7a0bd0f4adfe60de2160f04 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 23 Nov 2011 02:53:09 +0000 Subject: [PATCH] Check error code of path_lookup() on pre-39 kernels. Suggested by Lev Vainblat git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3939 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_pres.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 447316637..088b78160 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -1185,7 +1185,8 @@ static int scst_pr_check_pr_path(void) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) res = path_lookup(SCST_PR_DIR, 0, &nd); - scst_pr_path_put(&nd); + if (res == 0) + scst_pr_path_put(&nd); #else res = kern_path(SCST_PR_DIR, 0, &path); if (res == 0)