⬢ DragonFlyBSD Kernel Audit
DF-2444 / fix.diff
← back to finding ↓ download raw
# DF-2444 fix (authored post-verification; not applied to sys/)
--- a/sys/dev/disk/dm/dm_dev.c
+++ b/sys/dev/disk/dm/dm_dev.c
@@ -262,8 +262,8 @@ dm_dev_create(dm_dev_t **dmvp, const char *name, const char *uuid, int flags)
 	udev_dict_set_cstr(dmv->devt, "subsystem", "disk");
 
 	if ((r = dm_dev_insert(dmv)) != 0)
 		dm_dev_destroy(dmv);
+	else
+		*dmvp = dmv;
-
-	*dmvp = dmv;
 
 	return r;