From: kalpak Date: Wed, 18 Feb 2009 17:29:57 +0000 (+0000) Subject: b=18532 X-Git-Tag: v1_9_162~43 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=69fb67289f65d6ccf1e66837323daaed72bea928;p=fs%2Flustre-release.git b=18532 o=huanghua i=nathan i=kalpak fix possible memory leak in mdd_dot_lustre_setup() and create_dot_lustre_dir() --- diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 8236e3d..c47a0b5 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -326,6 +326,9 @@ static int create_dot_lustre_dir(const struct lu_env *env, struct mdd_device *m) RETURN(rc); } + if (!IS_ERR(mdo)) + lu_object_put(env, &mdo->mo_lu); + return 0; } @@ -672,8 +675,6 @@ static int mdd_dot_lustre_setup(const struct lu_env *env, struct mdd_device *m) m->mdd_dot_lustre = lu2mdd_obj(lu_object_locate(dt_dot_lustre->do_lu.lo_header, &mdd_device_type)); - lu_object_put(env, &dt_dot_lustre->do_lu); - m->mdd_dot_lustre->mod_obj.mo_dir_ops = &mdd_dot_lustre_dir_ops; m->mdd_dot_lustre->mod_obj.mo_ops = &mdd_dot_lustre_obj_ops;