⬢ DragonFlyBSD Kernel Audit
DF-2806 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/kern_udev.c	2026-06-29 12:51:19.000000000 +0000
+++ b/sys/kern/kern_udev.c	2026-10-26 01:39:50.408417911 +0000
@@ -586,15 +590,19 @@
 
 	KKASSERT(dev != NULL);
 
-	error = ENOMEM;
+	error = 0;
 
 	udict = udev_get_dict(dev);
 	if (alias) {
-		if (udict == NULL)
+		if (udict == NULL) {
+			error = ENOMEM;
 			goto error_out;
+		}
 		dict = prop_dictionary_copy(udict);
-		if (dict == NULL)
+		if (dict == NULL) {
+			error = ENOMEM;
 			goto error_out;
+		}
 
 		if ((error = _udev_dict_set_cstr(dict, "name", name))) {
 			prop_object_release(dict);