In hsm_cdt_request_completed() if a restore handle could not be found,
don't dereference the NULL crh returned by hsm_restore_hdl_find().
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I175f506d0acdecfef36352638bda2ada66d182db
Reviewed-on: http://review.whamcloud.com/7470
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
/* just give back layout lock, we keep
* the reference which is given back
* later with the lock for HSM flags */
- if (!IS_ERR(obj))
+ if (!IS_ERR(obj) && crh != NULL)
mdt_object_unlock(mti, obj, &crh->crh_lh, 1);
+
if (crh != NULL)
OBD_SLAB_FREE_PTR(crh, mdt_hsm_cdt_kmem);
}