Fix coverity defects: CID 152975

CID 152975: Type:Dereference null return value

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn>
Closes #5322
This commit is contained in:
cao 2016-11-01 07:23:56 +08:00 committed by Brian Behlendorf
parent 4aafab91c5
commit b182ac00aa

View File

@ -369,12 +369,17 @@ dmu_spill_hold_by_dnode(dnode_t *dn, uint32_t flags, void *tag, dmu_buf_t **dbp)
if ((flags & DB_RF_HAVESTRUCT) == 0)
rw_exit(&dn->dn_struct_rwlock);
ASSERT(db != NULL);
if (db == NULL) {
*dbp = NULL;
return (SET_ERROR(EIO));
}
err = dbuf_read(db, NULL, flags);
if (err == 0)
*dbp = &db->db;
else
else {
dbuf_rele(db, tag);
*dbp = NULL;
}
return (err);
}