Whamcloud - gitweb
LU-4629 ldlm: fix uninitialized variable 64/10664/3
authorDmitry Eremin <dmitry.eremin@intel.com>
Tue, 10 Jun 2014 17:46:55 +0000 (21:46 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Jun 2014 03:54:53 +0000 (03:54 +0000)
'rc' might be used uninitialized in this function.

ldlm_lib.c:1902: 'rc' is declared.
ldlm_lib.c:1910: req->rq_export->exp_disconnected is false
ldlm_lib.c:1951: 'rc' is used, but is uninitialized.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I0cea444d564f3806ed1d926ca5f4909f7005e240
Reviewed-on: http://review.whamcloud.com/10664
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/ldlm/ldlm_lib.c

index c5067ad..c22eccb 100644 (file)
@@ -1896,12 +1896,10 @@ static struct ptlrpc_request *target_next_final_ping(struct obd_device *obd)
        return req;
 }
 
-static int handle_recovery_req(struct ptlrpc_thread *thread,
-                               struct ptlrpc_request *req,
-                               svc_handler_t handler)
+static void handle_recovery_req(struct ptlrpc_thread *thread,
+                               struct ptlrpc_request *req,
+                               svc_handler_t handler)
 {
-       int rc;
-
        ENTRY;
 
        /**
@@ -1909,7 +1907,7 @@ static int handle_recovery_req(struct ptlrpc_thread *thread,
         * it after that, discard such request silently
         */
        if (req->rq_export->exp_disconnected)
-               GOTO(reqcopy_put, rc = 0);
+               RETURN_EXIT;
 
        req->rq_session.lc_thread = thread;
        req->rq_svc_thread = thread;
@@ -1948,8 +1946,7 @@ static int handle_recovery_req(struct ptlrpc_thread *thread,
                 }
                 extend_recovery_timer(class_exp2obd(req->rq_export), to, true);
         }
-reqcopy_put:
-        RETURN(rc);
+       EXIT;
 }
 
 static int target_recovery_thread(void *arg)