Whamcloud - gitweb
LU-2749 ofd: check return value of ofd_seq_load
[fs/lustre-release.git] / lustre / ofd / ofd_fs.c
index b1c7c98..9b61f58 100644 (file)
@@ -252,6 +252,10 @@ void ofd_seqs_fini(const struct lu_env *env, struct ofd_device *ofd)
        return;
 }
 
+/**
+ *
+ * \retval the seq with seq number or errno (never NULL)
+ */
 struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
                             obd_seq seq)
 {
@@ -323,7 +327,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
        }
 
        oseq = ofd_seq_add(env, ofd, oseq);
-       RETURN(oseq);
+       RETURN((oseq != NULL) ? oseq : ERR_PTR(-ENOENT));
 cleanup:
        ofd_seq_put(env, oseq);
        return ERR_PTR(rc);