Whamcloud - gitweb
b=11013
authornathan <nathan>
Mon, 19 Mar 2007 23:11:10 +0000 (23:11 +0000)
committernathan <nathan>
Mon, 19 Mar 2007 23:11:10 +0000 (23:11 +0000)
This is a potential null pointer dereference.
Caught by HEAD's conf_sanity test 29

lustre/ptlrpc/connection.c

index 23acbd7..7c31d4a 100644 (file)
@@ -135,7 +135,7 @@ out_conn:
 int ptlrpc_put_connection(struct ptlrpc_connection *c)
 {
         int rc = 0;
-        lnet_process_id_t peer = c->c_peer;
+        lnet_process_id_t peer;
         ENTRY;
 
         if (c == NULL) {
@@ -143,6 +143,8 @@ int ptlrpc_put_connection(struct ptlrpc_connection *c)
                 RETURN(0);
         }
 
+        peer = c->c_peer;
+
         CDEBUG (D_INFO, "connection=%p refcount %d to %s\n",
                 c, atomic_read(&c->c_refcount) - 1, 
                 libcfs_nid2str(c->c_peer.nid));