Whamcloud - gitweb
LU-5591 lod: fix Null pointer dereference in lod_ah_init() 70/11770/8
authorDmitry Eremin <dmitry.eremin@intel.com>
Fri, 5 Sep 2014 13:35:55 +0000 (17:35 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 4 Nov 2014 18:04:33 +0000 (18:04 +0000)
Null pointer may be dereferenced in lod_ah_init()

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I76567d222ac7eb74440c74692aaa79f7078bca61
Reviewed-on: http://review.whamcloud.com/11770
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_object.c

index 9417ba3..8c2c8d1 100644 (file)
@@ -3085,9 +3085,12 @@ static void lod_ah_init(const struct lu_env *env,
         * in case of late striping creation, ->ah_init()
         * can be called with local object existing
         */
-       if (!dt_object_exists(nextc) || dt_object_remote(nextc))
-               nextc->do_ops->do_ah_init(env, ah, dt_object_remote(nextp) ?
-                                         NULL : nextp, nextc, child_mode);
+       if (!dt_object_exists(nextc) || dt_object_remote(nextc)) {
+               struct dt_object *obj;
+
+               obj = (nextp != NULL && dt_object_remote(nextp)) ? NULL : nextp;
+               nextc->do_ops->do_ah_init(env, ah, obj, nextc, child_mode);
+       }
 
        if (S_ISDIR(child_mode)) {
                if (lc->ldo_dir_stripe == NULL) {