From 9a19fbb99c0ff309c58ce1e1fc864dd22edb5d25 Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 25 Jan 2006 11:14:11 +0000 Subject: [PATCH] Branch b_release_1_4_6 Fix potential NULL obd deref in client_disconnect_export() (COV:708) b=10098 --- lustre/ldlm/ldlm_lib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index a2a0173..b84e6e3 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -414,8 +414,8 @@ out_sem: int client_disconnect_export(struct obd_export *exp) { struct obd_device *obd = class_exp2obd(exp); - struct client_obd *cli = &obd->u.cli; - struct obd_import *imp = cli->cl_import; + struct client_obd *cli; + struct obd_import *imp; int rc = 0, err; ENTRY; @@ -425,6 +425,9 @@ int client_disconnect_export(struct obd_export *exp) RETURN(-EINVAL); } + cli = &obd->u.cli; + imp = cli->cl_import; + down(&cli->cl_sem); if (!cli->cl_conn_count) { CERROR("disconnecting disconnected device (%s)\n", -- 1.8.3.1