Fix 'NULL pointer dereference' defects found by Coverity version
6.6.1:
Dereference after null check (FORWARD_NULL)
For instance, Passing null pointer to a function which dereferences
it.
Dereference before null check (REVERSE_INULL)
Null-checking variable suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
Dereference null return value (NULL_RETURNS)
Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I1db4e80fd2c048cc20459e8da4cb61a97b3171cb
Reviewed-on: http://review.whamcloud.com/7827
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
iops = &obj->do_index_ops->dio_it;
LASSERT(iops != NULL);
- LASSERT(obj != NULL);
LASSERT(param->fsp_it != NULL);
iops->fini(¶m->fsp_env, param->fsp_it);
lu_env_fini(¶m->fsp_env);
struct lov_ost_data_v1 *objs)
{
struct lod_thread_info *info = lod_env_info(env);
- struct lod_device *md = lu2lod_dev(lo->ldo_obj.do_lu.lo_dev);
+ struct lod_device *md;
struct lu_object *o, *n;
struct lu_device *nd;
struct dt_object **stripe;
ENTRY;
LASSERT(lo != NULL);
+ md = lu2lod_dev(lo->ldo_obj.do_lu.lo_dev);
LASSERT(lo->ldo_stripe == NULL);
LASSERT(lo->ldo_stripenr > 0);
LASSERT(lo->ldo_stripe_size > 0);
if (rc)
RETURN(rc);
magic = le32_to_cpu(lmm->lmm_magic);
+ pattern = le32_to_cpu(lmm->lmm_pattern);
} else {
magic = LOV_MAGIC;
stripe_count = lov_get_stripecnt(lov, magic, 0);
+ pattern = LOV_PATTERN_RAID0;
}
/* If we aren't passed an lsmp struct, we just want the size */
RETURN(0);
}
- pattern = le32_to_cpu(lmm->lmm_pattern);
lsm_size = lov_alloc_memmd(lsmp, stripe_count, pattern, magic);
if (lsm_size < 0)
RETURN(lsm_size);