In osd_obj_update_entry(), the variable @oi_fid may be NULL.
We need to check such case before further using it to avoid
accessing invalid RAM.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ibf47e949d69f0b9e5657a6dce2007fe4f6f1a9f6
Reviewed-on: http://review.whamcloud.com/17010
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
GOTO(out, rc = -EEXIST);
}
- if (fid_is_idif(fid) && fid_is_idif(oi_fid)) {
+ if (fid_is_idif(fid) && oi_fid != NULL && fid_is_idif(oi_fid)) {
__u32 idx1 = fid_idif_ost_idx(fid);
__u32 idx2 = fid_idif_ost_idx(oi_fid);
struct ost_id *ostid = &info->oti_ostid;