diff --git sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c index 35151165e2b..964aa6c054f 100644 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c @@ -325,8 +325,10 @@ ddt_phys_addref(ddt_phys_t *ddp) void ddt_phys_decref(ddt_phys_t *ddp) { - ASSERT((int64_t)ddp->ddp_refcnt > 0); - ddp->ddp_refcnt--; + if (ddp) { + ASSERT((int64_t)ddp->ddp_refcnt > 0); + ddp->ddp_refcnt--; + } } void diff --git sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c index 3a58bda1b5f..a026b3bfe02 100644 --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c @@ -2937,8 +2937,11 @@ zio_ddt_free(zio_t *zio) ddt_enter(ddt); freedde = dde = ddt_lookup(ddt, bp, B_TRUE); - ddp = ddt_phys_select(dde, bp); - ddt_phys_decref(ddp); + if (dde) { + ddp = ddt_phys_select(dde, bp); + if (ddp) + ddt_phys_decref(ddp); + } ddt_exit(ddt); return (zio);