From 395611e57de9e097a1b617c34e973c390443ef1f Mon Sep 17 00:00:00 2001 From: huanghua Date: Wed, 22 Nov 2006 07:36:34 +0000 Subject: [PATCH] fix oops while accessing NULL pointer --- lustre/lmv/lmv_internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ -- 1.8.3.1