staging: lustre: fix 'NULL pointer dereference' errors
[cascardo/linux.git] / drivers / staging / lustre / lustre / lmv / lmv_obd.c
index 5c055a0..267f001 100644 (file)
@@ -238,7 +238,7 @@ static int lmv_connect(const struct lu_env *env,
         * and MDC stuff will be called directly, for instance while reading
         * ../mdc/../kbytesfree procfs file, etc.
         */
-       if (data->ocd_connect_flags & OBD_CONNECT_REAL)
+       if (data && data->ocd_connect_flags & OBD_CONNECT_REAL)
                rc = lmv_check_connect(obd);
 
        if (rc && lmv->lmv_tgts_kobj)