Whamcloud - gitweb
LU-9679 lustre: make ptlrpc_connection_put() static inline
[fs/lustre-release.git] / lustre / ptlrpc / import.c
index 389e6c9..9674217 100644 (file)
@@ -594,15 +594,13 @@ static int import_select_connection(struct obd_import *imp)
        imp_conn->oic_last_attempt = ktime_get_seconds();
 
        /* switch connection, don't mind if it's same as the current one */
-       if (imp->imp_connection)
-               ptlrpc_connection_put(imp->imp_connection);
+       ptlrpc_connection_put(imp->imp_connection);
        imp->imp_connection = ptlrpc_connection_addref(imp_conn->oic_conn);
 
        dlmexp = class_conn2export(&imp->imp_dlm_handle);
        if (!dlmexp)
                GOTO(out_unlock, rc = -EINVAL);
-       if (dlmexp->exp_connection)
-               ptlrpc_connection_put(dlmexp->exp_connection);
+       ptlrpc_connection_put(dlmexp->exp_connection);
        dlmexp->exp_connection = ptlrpc_connection_addref(imp_conn->oic_conn);
        class_export_put(dlmexp);