From 8003be0425c37fca66e463781a02e37be5fb2c7e Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Thu, 17 Nov 2011 10:47:00 +0800 Subject: [PATCH] LU-837 release semaphore for error case in gss_do_ctx_init_rpc in gss_do_ctx_init_rpc, the r/w lock "obd->u.cli.cl_sem" is not released if the obd->u.cli.cl_import is NULL and returns error. Change-Id: Ib9bb4d4cb79adabe8ff661b9b4a7f6df5963d4ff Signed-off-by: Hongchao Zhang Reviewed-on: http://review.whamcloud.com/1705 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Lai Siyao Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/ptlrpc/gss/gss_cli_upcall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/ptlrpc/gss/gss_cli_upcall.c b/lustre/ptlrpc/gss/gss_cli_upcall.c index eb9536b..80d5591 100644 --- a/lustre/ptlrpc/gss/gss_cli_upcall.c +++ b/lustre/ptlrpc/gss/gss_cli_upcall.c @@ -299,6 +299,7 @@ int gss_do_ctx_init_rpc(__user char *buffer, unsigned long count) cfs_down_read(&obd->u.cli.cl_sem); if (obd->u.cli.cl_import == NULL) { CERROR("obd %s: import has gone\n", obd->obd_name); + cfs_up_read(&obd->u.cli.cl_sem); RETURN(-EINVAL); } imp = class_import_get(obd->u.cli.cl_import); -- 1.8.3.1