Skip to content

Commit

Permalink
5592 NULL pointer dereference in dsl_prop_notify_all_cb()
Browse files Browse the repository at this point in the history
Reviewed by: Dan McDonald <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Will Andrews <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
  • Loading branch information
Justin T. Gibbs authored and rmustacc committed Feb 4, 2015
1 parent bd181d5 commit 9d47dec
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions usr/src/uts/common/fs/zfs/dsl_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,19 @@ dsl_dataset_snap_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx,
boolean_t
dsl_dataset_try_add_ref(dsl_pool_t *dp, dsl_dataset_t *ds, void *tag)
{
return (dmu_buf_try_add_ref(ds->ds_dbuf, dp->dp_meta_objset,
ds->ds_object, DMU_BONUS_BLKID, tag));
dmu_buf_t *dbuf = ds->ds_dbuf;
boolean_t result = B_FALSE;

if (dbuf != NULL && dmu_buf_try_add_ref(dbuf, dp->dp_meta_objset,
ds->ds_object, DMU_BONUS_BLKID, tag)) {

if (ds == dmu_buf_get_user(dbuf))
result = B_TRUE;
else
dmu_buf_rele(dbuf, tag);
}

return (result);
}

int
Expand Down

0 comments on commit 9d47dec

Please sign in to comment.