diff --git a/sys/dev/disk/dm/dm_dev.c b/sys/dev/disk/dm/dm_dev.c --- a/sys/dev/disk/dm/dm_dev.c +++ b/sys/dev/disk/dm/dm_dev.c @@ -192,7 +192,12 @@ TAILQ_INSERT_TAIL(&dm_dev_list, dev, next_devlist); dm_dev_counter++; } else { - KKASSERT(dmv != NULL); + /* + * Device with this name or uuid already exists. + * dmv may be NULL here (uuid was zero-filled, so the + * uuid lookup was skipped, but the name/minor lookup + * matched). That is fine -- we return EEXIST either way. + */ r = EEXIST; }