From: huanghua Date: Wed, 22 Nov 2006 07:36:34 +0000 (+0000) Subject: fix oops while accessing NULL pointer X-Git-Tag: v1_8_0_110~486^2~100 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=395611e57de9e097a1b617c34e973c390443ef1f;p=fs%2Flustre-release.git fix oops while accessing NULL pointer --- diff --git a/lustre/lmv/lmv_internal.h b/lustre/lmv/lmv_internal.h index 27fb215..643330d 100644 --- a/lustre/lmv/lmv_internal.h +++ b/lustre/lmv/lmv_internal.h @@ -204,7 +204,11 @@ lmv_find_target(struct lmv_obd *lmv, const struct lu_fid *fid) static inline struct obd_export * lmv_find_export(struct lmv_obd *lmv, const struct lu_fid *fid) { - return lmv_find_target(lmv, fid)->ltd_exp; + struct lmv_tgt_desc *tgt = lmv_find_target(lmv, fid); + if (IS_ERR(tgt)) + return (struct obd_export*)tgt; + else + return tgt->ltd_exp; } /* lproc_lmv.c */